Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-17347

C++ 17 structured binding support

    XMLWordPrintable

Details

    Description

      Hi,

      C++17 supports "structured bindings" . You can find the paper here: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0217r3.html

      The example below works in C++17, but Qt Creator underlines the for line in red.

        std::map<int, std::string> test = {
          {1, "one"},
          {2, "two"},
          {3, "three"}
        };
      
        for (auto&& [key, value]: test)
        {
          std::cout << key << " " << value << std::endl;
        }
      

      I could not test the clang code model as i had a custom clang version compiled without recompiling qtcreator for it's clang codemodel plugin.

      Attachments

        Issue Links

          Activity

            People

              kosjar Nikolai Kosjar
              markg85 Mark
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: