diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-12-06 15:54:07 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-12-06 15:54:07 +0200 |
commit | 8e258e150743f9d71a7bbd9f70af78a05d354456 (patch) | |
tree | a7da748a935e965bfe7de93eb2c9fd7192d4878e /build2/parser.cxx | |
parent | beffa27ce8038c8e6d30b90f95a9d55ff5068c08 (diff) |
Work around wrong static initialization order in VC
Diffstat (limited to 'build2/parser.cxx')
-rw-r--r-- | build2/parser.cxx | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/build2/parser.cxx b/build2/parser.cxx index 87ec8b1..c47cc8b 100644 --- a/build2/parser.cxx +++ b/build2/parser.cxx @@ -1520,18 +1520,20 @@ namespace build2 static const value_type* map_type (const string& n) { + auto ptr = [] (const value_type& vt) {return &vt;}; + return - n == "bool" ? &value_traits<bool>::value_type : - n == "uint64" ? &value_traits<uint64_t>::value_type : - n == "string" ? &value_traits<string>::value_type : - n == "path" ? &value_traits<path>::value_type : - n == "dir_path" ? &value_traits<dir_path>::value_type : - n == "abs_dir_path" ? &value_traits<abs_dir_path>::value_type : - n == "name" ? &value_traits<name>::value_type : - n == "strings" ? &value_traits<strings>::value_type : - n == "paths" ? &value_traits<paths>::value_type : - n == "dir_paths" ? &value_traits<dir_paths>::value_type : - n == "names" ? &value_traits<vector<name>>::value_type : + n == "bool" ? ptr (value_traits<bool>::value_type) : + n == "uint64" ? ptr (value_traits<uint64_t>::value_type) : + n == "string" ? ptr (value_traits<string>::value_type) : + n == "path" ? ptr (value_traits<path>::value_type) : + n == "dir_path" ? ptr (value_traits<dir_path>::value_type) : + n == "abs_dir_path" ? ptr (value_traits<abs_dir_path>::value_type) : + n == "name" ? ptr (value_traits<name>::value_type) : + n == "strings" ? ptr (value_traits<strings>::value_type) : + n == "paths" ? ptr (value_traits<paths>::value_type) : + n == "dir_paths" ? ptr (value_traits<dir_paths>::value_type) : + n == "names" ? ptr (value_traits<vector<name>>::value_type) : nullptr; } |