Author
anonymous
over 7 years ago
Language
C++
Compiler
gcc 8.2.0
Options
Warnings
Don't Use Boost
C++17
no pedantic
Author
anonymous
over 7 years ago
$ g++ prog.cc -Wall -Wextra -std=c++17 prog.cc: In instantiation of 'void send(const T&, std::enable_if_t<(has_first_type<T>::value && has_second_type<T>::value), int>) [with T = std::pair<std::vector<int>, std::vector<int> >; std::enable_if_t<(has_first_type<T>::value && has_second_type<T>::value), int> = int]':
prog.cc:50:13: required from here
prog.cc:35:133: error: no matching function for call to 'send(const std::vector<int>&)'
template <typename T> void send(const T& p, std::enable_if_t<has_first_type<T>::value && has_second_type<T>::value, int> = 0) { send(p.first); send(p.second); }
~~~~^~~~~~~~~
prog.cc:34:6: note: candidate: 'void send(int)'
void send(int i) { std::cout << i; }
^~~~
prog.cc:34:6: note: no known conversion for argument 1 from 'const std::vector<int>' to 'int'
prog.cc:35:28: note: candidate: 'template<class T> void send(const T&, std::enable_if_t<(has_first_type<T>::value && has_second_type<T>::value), int>)'
template <typename T> void send(const T& p, std::enable_if_t<has_first_type<T>::value && has_second_type<T>::value, int> = 0) { send(p.first); send(p.second); }
^~~~
prog.cc:35:28: note: template argument deduction/substitution failed:
prog.cc:35:148: error: no matching function for call to 'send(const std::vector<int>&)'
template <typename T> void send(const T& p, std::enable_if_t<has_first_type<T>::value && has_second_type<T>::value, int> = 0) { send(p.first); send(p.second); }
~~~~^~~~~~~~~~
prog.cc:34:6: note: candidate: 'void send(int)'
void send(int i) { std::cout << i; }
^~~~
prog.cc:34:6: note: no known conversion for argument 1 from 'const std::vector<int>' to 'int'
prog.cc:35:28: note: candidate: 'template<class T> void send(const T&, std::enable_if_t<(has_first_type<T>::value && has_second_type<T>::value), int>)'
template <typename T> void send(const T& p, std::enable_if_t<has_first_type<T>::value && has_second_type<T>::value, int> = 0) { send(p.first); send(p.second); }
^~~~
prog.cc:35:28: note: template argument deduction/substitution failed:
Exit Code:
1