martinmoene/expected-lite

Build example error

crudine9 opened this issue · 2 comments

Hi,

with the flag -DEXPECTED_LITE_OPT_BUILD_EXAMPLES=ON the build (gcc-7) produces following error

`expected-lite/include/nonstd/expected.hpp: In instantiation of ‘class nonstd::expected_lite::expected<required, char>’:

expected-lite/example/02-required.cpp:45:30: required from here
expected-lite/include/nonstd/expected.hpp:1103:22: error: no type named ‘type’ in ‘struct std::enable_if<false, void*>’
nsel_constexpr14 expected( expected const & other
^~~~~~~~
expected-lite/include/nonstd/expected.hpp:1214:22: error: no type named ‘type’ in ‘struct std::enable_if<false, void*>’
nsel_constexpr14 expected( value_type const & value
^~~~~~~~
expected-lite/include/nonstd/expected.hpp:1378:5: error: no type named ‘type’ in ‘struct std::enable_if<false, nonstd::expected_lite::expected<required, char>&>’
operator=( expected const & other )
^~~~~~~~
expected-lite/include/nonstd/expected.hpp:1391:5: error: no type named ‘type’ in ‘struct std::enable_if<false, nonstd::expected_lite::expected<required, char>&>’
operator=( expected && other ) noexcept
^~~~~~~~
expected-lite/include/nonstd/expected.hpp:1469:5: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
swap( expected & other ) noexcept
^~~~
`
Trying to use it in project produces also the same error. I don't understand what could be the problem.

Thanks @crudine9 , example/02-required.cpp no longer compiles after changes to the implementation of expected.hpp to make it follow the proposal more strictly. I'll have to reconsider this example.

Think this can be closed.