Author
anonymous
over 6 years ago
Language
C++
Compiler
gcc 8.2.0
Options
Warnings
Boost 1.68.0
C++17(GNU)
no pedantic
Author
anonymous
over 6 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.68.0/gcc-8.2.0/include -std=gnu++17
In file included from prog.cc:1:
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/optional: In instantiation of 'constexpr std::__optional_relop_t<decltype ((declval<_Tp>() < declval<_Up>()))> std::operator<(const std::optional<_Tp>&, const std::optional<_Up>&) [with _Tp = n1::tag; _Up = n2::tag; std::__optional_relop_t<decltype ((declval<_Tp>() < declval<_Up>()))> = <type error>]':
prog.cc:23:15: required from here
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/optional:1341:60: error: no match for 'operator<' (operand types are 'const n1::tag' and 'const n2::tag')
return static_cast<bool>(__rhs) && (!__lhs || *__lhs < *__rhs);
~~~~~~~^~~~~~~~
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/optional:1341:60: note: candidate: 'operator<(n2::tag, n2::tag)' <built-in>
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/optional:1341:60: note: no known conversion for argument 1 from 'const n1::tag' to 'n2::tag'
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/optional:1341:60: note: candidate: 'operator<(n1::tag, n1::tag)' <built-in>
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/optional:1341:60: note: no known conversion for argument 2 from 'const n2::tag' to 'n1::tag'
prog.cc: In function 'int main()':
prog.cc:23:7: warning: unused variable 't' [-Wunused-variable]
bool t = (o1 < o2);
^
Exit Code:
1