Author
anonymous
about 5 years ago
Language
C++
Compiler
gcc 8.2.0
Options
Warnings
Boost 1.71.0
C++2a(GNU)
no pedantic
Author
anonymous
about 5 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.71.0/gcc-8.2.0/include -std=gnu++2a
prog.cc: In function 'int main(int, char**)':
prog.cc:26:58: error: no match for 'operator=' (operand types are 'std::tuple<int&, double&>' and 'NumberConvertor')
std::tie(int_part, frac_part) = NumberConvertor(1.618);
^
In file included from prog.cc:1:
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/tuple:1209:7: note: candidate: 'std::tuple<_T1, _T2>& std::tuple<_T1, _T2>::operator=(const std::tuple<_T1, _T2>&) [with _T1 = int&; _T2 = double&]'
operator=(const tuple& __in)
^~~~~~~~
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/tuple:1209:7: note: no known conversion for argument 1 from 'NumberConvertor' to 'const std::tuple<int&, double&>&'
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/tuple:1216:7: note: candidate: 'std::tuple<_T1, _T2>& std::tuple<_T1, _T2>::operator=(std::tuple<_T1, _T2>&&) [with _T1 = int&; _T2 = double&]'
operator=(tuple&& __in)
^~~~~~~~
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/tuple:1216:7: note: no known conversion for argument 1 from 'NumberConvertor' to 'std::tuple<int&, double&>&&'
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/tuple:1225:9: note: candidate: 'template<class _U1, class _U2> std::tuple<_T1, _T2>& std::tuple<_T1, _T2>::operator=(const std::tuple<_U1, _U2>&) [with _U1 = _U1; _U2 = _U2; _T1 = int&; _T2 = double&]'
operator=(const tuple<_U1, _U2>& __in)
^~~~~~~~
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/tuple:1225:9: note: template argument deduction/substitution failed:
prog.cc:26:58: note: 'NumberConvertor' is not derived from 'const std::tuple<_T1, _T2>'
std::tie(int_part, frac_part) = NumberConvertor(1.618);
^
In file included from prog.cc:1:
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/tuple:1233:9: note: candidate: 'template<class _U1, class _U2> std::tuple<_T1, _T2>& std::tuple<_T1, _T2>::operator=(std::tuple<_U1, _U2>&&) [with _U1 = _U1; _U2 = _U2; _T1 = int&; _T2 = double&]'
operator=(tuple<_U1, _U2>&& __in)
^~~~~~~~
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/tuple:1233:9: note: template argument deduction/substitution failed:
prog.cc:26:58: note: 'NumberConvertor' is not derived from 'std::tuple<_T1, _T2>'
std::tie(int_part, frac_part) = NumberConvertor(1.618);
^
In file included from prog.cc:1:
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/tuple:1241:9: note: candidate: 'template<class _U1, class _U2> std::tuple<_T1, _T2>& std::tuple<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) [with _U1 = _U1; _U2 = _U2; _T1 = int&; _T2 = double&]'
operator=(const pair<_U1, _U2>& __in)
^~~~~~~~
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/tuple:1241:9: note: template argument deduction/substitution failed:
prog.cc:26:58: note: 'NumberConvertor' is not derived from 'const std::pair<_T1, _T2>'
std::tie(int_part, frac_part) = NumberConvertor(1.618);
^
In file included from prog.cc:1:
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/tuple:1250:9: note: candidate: 'template<class _U1, class _U2> std::tuple<_T1, _T2>& std::tuple<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) [with _U1 = _U1; _U2 = _U2; _T1 = int&; _T2 = double&]'
operator=(pair<_U1, _U2>&& __in)
^~~~~~~~
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/tuple:1250:9: note: template argument deduction/substitution failed:
prog.cc:26:58: note: 'NumberConvertor' is not derived from 'std::pair<_T1, _T2>'
std::tie(int_part, frac_part) = NumberConvertor(1.618);
^
prog.cc:23:14: warning: unused parameter 'argc' [-Wunused-parameter]
int main(int argc, char** argv) {
~~~~^~~~
prog.cc:23:27: warning: unused parameter 'argv' [-Wunused-parameter]
int main(int argc, char** argv) {
~~~~~~~^~~~
Exit Code:
1