Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

about 7 years ago

Language

Compiler

Options

Author

anonymous

about 7 years ago

$
prog.cc: In lambda function:
prog.cc:13:33: error: inconsistent types 'std::nullopt_t' and 'std::optional<int>' deduced for lambda return type
         return std::optional{f()};
                                 ^
prog.cc:13:33: error: no matching function for call to 'std::nullopt_t::nullopt_t(std::optional<int>)'
In file included from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/9.0.0/optional:70:24: note: candidate: 'constexpr std::nullopt_t::nullopt_t(std::nullopt_t::_Construct)'
     explicit constexpr nullopt_t(_Construct) { }
                        ^~~~~~~~~
/opt/wandbox/gcc-head/include/c++/9.0.0/optional:70:24: note:   no known conversion for argument 1 from 'std::optional<int>' to 'std::nullopt_t::_Construct'
/opt/wandbox/gcc-head/include/c++/9.0.0/optional:60:10: note: candidate: 'constexpr std::nullopt_t::nullopt_t(const std::nullopt_t&)'
   struct nullopt_t
          ^~~~~~~~~
/opt/wandbox/gcc-head/include/c++/9.0.0/optional:60:10: note:   no known conversion for argument 1 from 'std::optional<int>' to 'const std::nullopt_t&'
/opt/wandbox/gcc-head/include/c++/9.0.0/optional:60:10: note: candidate: 'constexpr std::nullopt_t::nullopt_t(std::nullopt_t&&)'
/opt/wandbox/gcc-head/include/c++/9.0.0/optional:60:10: note:   no known conversion for argument 1 from 'std::optional<int>' to 'std::nullopt_t&&'
Exit Code:
1