Last active
June 27, 2018 19:55
-
-
Save reupen/52ff0c9a49a8e75bf1c6f272ed09db11 to your computer and use it in GitHub Desktop.
Structured bindings compiler error with VS2017 15.8 preview 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Does not compile with /permissive- /std:c++17 | |
// Yields: | |
// f:\playground\vc2017\vc2017\moo.cpp(16): error C3861: 'id': identifier not found | |
// f:\playground\vc2017\vc2017\moo.cpp(16) : error C3861 : 'name' : identifier not found | |
#include <vector> | |
#include <tuple> | |
template<typename Args> | |
class Moo { | |
public: | |
std::vector<std::tuple<unsigned, std::string>> m_data; | |
void test() | |
{ | |
// Also, changing auto& to auto&& causes an internal compiler error here | |
for (auto& [id, moo] : m_data) { | |
} | |
} | |
}; | |
int main() | |
{ | |
Moo<unsigned>().test(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment