Author
anonymous
almost 5 years ago
Language
C++
Compiler
gcc HEAD 11.0.0 20210105 (experimental)
Options
Warnings
Boost 1.73.0
C++2a(GNU)
no pedantic
Author
anonymous
almost 5 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=gnu++2a prog.cc: In function 'int main()':
prog.cc:18:14: error: no matching function for call to 'add(std::vector<std::atomic<int> >&, std::atomic<int>&)'
18 | add(aiVec, ai); // ERROR: cannot copy/move atomics
| ^
prog.cc:9:6: note: candidate: 'template<class Coll, class T> requires convertible_to<T, typename Coll::value_type> void add(Coll&, const T&)'
9 | void add(Coll& coll, const T& val)
| ^~~
prog.cc:9:6: note: template argument deduction/substitution failed:
prog.cc:9:6: note: constraints not satisfied
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/compare:39,
from /opt/wandbox/gcc-head/include/c++/11.0.0/bits/stl_pair.h:65,
from /opt/wandbox/gcc-head/include/c++/11.0.0/bits/stl_algobase.h:64,
from /opt/wandbox/gcc-head/include/c++/11.0.0/bits/char_traits.h:39,
from /opt/wandbox/gcc-head/include/c++/11.0.0/ios:40,
from /opt/wandbox/gcc-head/include/c++/11.0.0/ostream:38,
from /opt/wandbox/gcc-head/include/c++/11.0.0/iostream:39,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/concepts: In substitution of 'template<class Coll, class T> requires convertible_to<T, typename Coll::value_type> void add(Coll&, const T&) [with Coll = std::vector<std::atomic<int> >; T = std::atomic<int>]':
prog.cc:18:14: required from here
/opt/wandbox/gcc-head/include/c++/11.0.0/concepts:72:13: required for the satisfaction of 'convertible_to<T, typename Coll::value_type>' [with T = std::atomic<int>; Coll = std::vector<std::atomic<int>, std::allocator<std::atomic<int> > >]
/opt/wandbox/gcc-head/include/c++/11.0.0/concepts:72:30: note: the expression 'is_convertible_v<_From, _To> [with _From = std::atomic<int>; _To = std::atomic<int>]' evaluated to 'false'
72 | concept convertible_to = is_convertible_v<_From, _To>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Exit Code:
1