CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: John E

Page 1 of 80 1 2 3 4

Search: Search took 0.54 seconds; generated 44 minute(s) ago.

  1. Replies
    8
    Views
    566

    Re: #warning and MSVC

    There are too many of them but I just realised that #pragma message is apparently supported by gcc - so hopefully I'll persuade the gcc programmers to use it instead of #warning :thumb:
  2. Replies
    8
    Views
    566

    Re: #warning and MSVC

    Wow, that looks even better - but I'd still need a way to convert #warning "whatever" into #pragma message("whatever")
  3. Replies
    8
    Views
    566

    Re: #warning and MSVC

    Thanks 2kaud but if I'm reading that article correctly, #pragma comment is for inserting a comment into the compiled file.

    Over on StackOverflow someone suggested using #pragma NOTE. It doesn't...
  4. Replies
    8
    Views
    566

    Re: #warning and MSVC

    Thanks 2kaud but I think that's intended for the official (i.e. numeric) warnings. OTOH #warning is generally followed by a user-defined text message
  5. Replies
    8
    Views
    566

    #warning and MSVC

    AFAICT it's not supported in MSVC but it seems to be much more common now for 3rd-party source code to contain #warning message lines. Is there any way they can be converted into something that'll...
  6. Replies
    2
    Views
    442

    Re: inline code - what are MSVC's "rules"

    Thanks 2kaud - the 3rd link leads to a page with 2 x examples. And the 2nd example states that any function that's defined within a header file is now regarded as being implicitly inlined. But what...
  7. Replies
    2
    Views
    442

    inline code - what are MSVC's "rules"

    We all know that Visual Studio is trying to support non-Microsoft compilers. I don't know how many are supported but Clang is one of them. Consider this code:-


    #if defined (BUILDING_DLL)
    ...
  8. Re: Does a static class var work in a static lib ?

    Thanks 2kaud - I can see how that'd work if the exe only ever uses static libs. But if the exe links to 3 x DLL's (and it's the DLL's which each need the static lib) surely there'll be 3 x copies of...
  9. Replies
    2
    Views
    357

    Re: VS2019 - Debugging without the exact code

    That looks promising Victor - many thanks!
  10. Does a static class var work in a static lib ?

    Consider the following code. Obviously the class is intended to get exported from a DLL - so there'll only ever be 1 x copy of some_var:-


    class __declspec(dllexport) whatever
    {
    public:...
  11. Replies
    3
    Views
    401

    Re: Some code I don't understand

    Ah, that makes sense now I've woken up - the actual class looks like this:-


    class timepos_t : public int62_t {
    public:
    timepos_t () : int62_t (false, 0) {}
    timepos_t (TimeDomain d) :...
  12. Replies
    3
    Views
    401

    Some code I don't understand

    I'm not sure if it's C++11 maybe but I just came across this line of code in a class declaration:-


    explicit timepos_t (samplepos_t s) : int62_t (false, samples_to_superclock (s,...
  13. Replies
    2
    Views
    357

    VS2019 - Debugging without the exact code

    In previous versions of VS I could press F5 to start a Debug session and if the code had changed slightly it'd give me the option to rebuild or not rebuild - but VS2019 always rebuilds without giving...
  14. Replies
    2
    Views
    503

    Re: Tryong to understand templates

    That looks promising 2kaud, thanks. :thumb: I'll try adapting it here for boost.
  15. Replies
    2
    Views
    503

    Tryong to understand templates

    I'm investigating a problem here when using boost::intrusive::list with templates but to get me started I wrote this small app (which works):-


    #include <boost/intrusive/list.hpp>
    #include...
  16. Replies
    8
    Views
    1,163

    Re: Stopping unnecessary style corrections

    Thanks 2kaud. I corrected that and I also discovered another setting at Tools/Options/Text Editor/C C++/Code Style/Formatting/When I paste. It was initially set to Indent and format

    But when I'm...
  17. Replies
    8
    Views
    1,163

    Re: Stopping unnecessary style corrections

    Thanks 2kaud - interestingly, my options were all disabled here. So I've just toggled them on and then off again.
  18. Replies
    8
    Views
    1,163

    Re: Stopping unnecessary style corrections

    Thanks 2kaud - I just seem to have 1 weird style thing renaming which I can't seem to track down - i.e. it's removing spaces if they're preceded by a comma. So something like this:-


    void Hello...
  19. Replies
    7
    Views
    937

    Re: Cancelling _declspec(dllexport)

    Yes you're right - the anonymous class needs to be instantiated, rather than just declared... how annoying!!

    I don't know if their posts are public or private but I've flagged this up on the...
  20. Replies
    7
    Views
    937

    Re: Cancelling _declspec(dllexport)

    Many thanks 2kaud - I'm just shutting down for the night but I'll give that a try tomorrow!
  21. Replies
    7
    Views
    937

    Re: Cancelling _declspec(dllexport)

    Another idea... does VC++ support anonymous classes or structs (I've a feeling some compilers do). I'm just wondering if something like this could work...


    class Whatever
    {
    protected:

    //...
  22. Replies
    7
    Views
    937

    Re: Cancelling _declspec(dllexport)

    An interesting problem... apparently anything using thread_local can be declared as either static or extern - but if it's a class member, it's only allowed to be static - and if the class itself is...
  23. Replies
    10
    Views
    1,548

    Re: Sizing a (stack based) array at run time

    Back when I first encountered this I was probably using VS2005 but I was surprised to find that it still isn't supported - even in VS2019 :cry:

    Or is it just a "gcc thing" ?
  24. Replies
    1
    Views
    419

    Using template without an argument type

    A program I'm working on seems to have a lot of functions like this in its header files:-


    template <>
    inline std::string to_string (bool val)
    {
    std::string tmp;
    bool_to_string (val, tmp);...
  25. Replies
    8
    Views
    1,163

    Stopping unnecessary style corrections

    A project I'm involved in has a style of inserting spaces for better visibility - like this:-


    int SomeFunc ( int whatever );

    but if I make any change to an existing line, VS2019 has an...
Results 1 to 25 of 1998
Page 1 of 80 1 2 3 4





Click Here to Expand Forum to Full Width

Featured