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

Search:

Type: Posts; User: 2kaud

Page 1 of 80 1 2 3 4

Search: Search took 0.17 seconds.

  1. Replies
    15
    Views
    376

    Re: A 'customised' std::list ??

    The code compiles OK with both gcc and clang as C++17 or as C++20 with a change for unique. See https://wandbox.org/permlink/tfhEOLLXuzGTdh7J

    The issue is only with VS. Hence I've moved this to...
  2. Replies
    15
    Views
    376

    Re: A 'customised' std::list ??

    I'd change it to C++17 - and re-compile everything.

    This C++17 example code demonstrates the problem:



    #include <list>

    using LT = std::list<int>;
    using func_t = void(LT::*)();
  3. Replies
    15
    Views
    376

    Re: A 'customised' std::list ??

    In VS2019, for the project/properties/general/C++ Language standard

    What's the value? Preview means using C++20 which has return values for these functions. C++17 and previous had return void for...
  4. Replies
    15
    Views
    376

    Re: A 'customised' std::list ??

    That's probably the issue. All the lines which now don't compile are those that reference functions that no longer return void, but have a return value - as of C++20! eg for C++20, unique() returns a...
  5. Replies
    15
    Views
    376

    Re: A 'customised' std::list ??

    What version of lua are you using? The latest version is 5.4.2

    There's also info on the internet as to how to use lua with C++ and classes as lua seems to be written in C. I've never used it.
  6. Replies
    15
    Views
    376

    Re: A 'customised' std::list ??

    My response in my post #2 is based upon what I remember reading some time ago (MSDN blog post?) about some changes to the way Microsoft implement some class member functions which would have some...
  7. Replies
    15
    Views
    376

    Re: A 'customised' std::list ??

    I think that this is due to changes in the stl implementation that means that some stl class members are no longer 'true functions' ie functions to which an address can be taken. There's nothing in...
  8. Re: Transferring items from an unsorted set to a sorted set

    operator() needs to be declared const



    bool operator()(const int* p1, const int* p2) const
  9. Replies
    3
    Views
    158

    Re: std::vector::reserve()

    John, please don't ask different questions in the same post. It's better to start a new post for each new question.
  10. Replies
    3
    Views
    158

    Re: std::vector::reserve()

    The assert is correct even if reserve is used. All reserve() does is to allocate memory (which MSVC does). It doesn't add any elements. If you just reserve and don't add any elements, then .size()...
  11. Replies
    19
    Views
    328

    Re: Template class inside a vector

    NO. Don't do it. Don't use a std::string (or any non POD type) in a union. If you want these three types, use a std::variant with C++17.

    I know you said you use C++11, but that is now over 9 years...
  12. Replies
    19
    Views
    328

    Re: Template class inside a vector

    In which case you can't use templates.

    If the compiler doesn't know the type at compile time, you're very limited as to what you can do. C++ is a strictly typed language.

    If you update to a...
  13. Replies
    2
    Views
    123

    Re: do while with find_if

    auto itr = std::find_if......


    The scope of this itr only exists until the block closing }. It does not extend to the while clause. The itr used in the while clause is the same as that defined...
  14. Replies
    5
    Views
    161

    Re: Libraries with the same function

    Where was the constellation of the planets and what was the phase of the moon when this event took place? :d

    I'm assuming because of the previous posts, that the function that isn't exported has...
  15. Replies
    5
    Views
    161

    Re: Libraries with the same function

    Use LoadLibrary()/GetProcAddress() to specify which one to use.
  16. Re: Puzzling error from std::stringstream in VS2019

    For differences between the various versions of VS2019, see https://www.tektutorialshub.com/visual-studio/difference-between-visual-studio-2019-community-vs-professional-vs-enterprise/
  17. Re: Puzzling error from std::stringstream in VS2019

    Have you tried creating a completly new solution with just the existing source files? IMO there's a solution file used in debugging that contains a wrong file reference. Try doing a file search for...
  18. Re: Puzzling error from std::stringstream in VS2019

    Just for interest/info - we stopped creating .dll's several years ago. We also stopped splitting classes into header/implementation files. Everything is now in .hpp files that are included as needed...
  19. Re: Puzzling error from std::stringstream in VS2019

    PS Has this fixed the previous error with the debug build with the missing subfolder? [ https://forums.codeguru.com/showthread.php?565257-Strange-crash-with-Debug-build ]
  20. Re: Puzzling error from std::stringstream in VS2019

    Under SDK's, libraries and frameworks - I have:

    C++ ATL for latest v142 build tools (x86 & x64)
    Windows 10 SDK (10.0.19041.0)
  21. Re: is it safe to use the bitwise XOR for boolean types (in c++)

    Yeah - Several C++ questions asked in this forum should be asked in the C++ (Non-visual C++ Issues) forum.
  22. Re: Puzzling error from std::stringstream in VS2019

    If both were built with VS2019, then I don't know. Other than there seems to be something wrong with your VS install. I'd be tempted to completely remove it and re-install from scratch. Have you got...
  23. Re: is it safe to use the bitwise XOR for boolean types (in c++)

    Yes - for OLE automation. There's quite a few different types - BSTR possibly being the most well known. They are not part of C++ though. These were developed by MS to help with interoperability with...
  24. Re: Puzzling error from std::stringstream in VS2019

    yes - probably because of different versions of std::stringstream exe/dll. You can't mix versions! This is the sort of thing that was called 'dll hell'! In the above, std::stringstream default...
  25. Re: is it safe to use the bitwise XOR for boolean types (in c++)

    All sins forgiven :)
Results 1 to 25 of 2000
Page 1 of 80 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)