CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17

Thread: A 'customised' std::list ??

  1. #16
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Manchester, England

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

    Over on the Microsoft forum one of the contributers suggested adding an extra line which - by some strange magic - seems to fix the compile:-

    #include <list>
    using LT = std::list<int>;
    using func_void_t = void(LT::*)();
    using func_ref_t = LT::reference(LT::*)();
    using func_iter_t = LT::iterator(LT::*)();
    using unused = decltype(std::declval<LT>().unique()); // <--- New line
    int main (int argc, char *argv[])
    // Non-overloaded members
    // Members with overloads
      func_void_t f5 = &LT::unique; // Now succeeds !!!
      return 0;
    But even over there they reckon it's a compiler bug and needs to get reported to the VC development team.
    "A problem well stated is a problem half solved. - Charles F. Kettering

  2. #17
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012

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

    The Bug has now been reported to the VS team and is now 'Under Investigation'. I'll update when there is more info.

    Nice workaround! I'd never of thought of that as that using unused... line should have absolutely no effect!
    Last edited by 2kaud; March 9th, 2021 at 05:05 AM.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++20 Compiler: Microsoft VS2019 (16.9.3)

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)