Closed hia3 closed 9 years ago
I've included boost/expected/expected.hpp in 2 translation units and got an error:
boost/expected/expected.hpp
error LNK2005: "struct boost::detail::only_set_valid_t boost::detail::only_set_valid" (?only_set_valid@detail@boost@@3Uonly_set_valid_t@12@A)
This is because there is no constexpr support in MSVC2013.
constexpr
Adding __declspec(selectany) before only_set_valid fixes this linker error (but I'm not sure if it works).
__declspec(selectany)
You could replace the line by
struct only_set_valid_t{};
as for the time being only_set_valid it is not used.
only_set_valid
https://github.com/ptal/expected/commit/6d0274dc50047e4da4a152296a5cb5552c46d97c
I've included
boost/expected/expected.hpp
in 2 translation units and got an error:This is because there is no
constexpr
support in MSVC2013.Adding
__declspec(selectany)
before only_set_valid fixes this linker error (but I'm not sure if it works).