Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

about 6 years ago

Language

C++

Compiler

gcc HEAD 9.0.1 20190218 (experimental)

Options
Warnings
Boost 1.68.0
C++2a(GNU)
-pedantic

Author

anonymous

about 6 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.68.0/gcc-head/include -std=gnu++2a -pedantic
prog.cc: In instantiation of 'void ReadCollection(Stream&, Coll&) [with Coll = std::set<int*>]':
prog.cc:30:27:   required from 'void Read(Stream&, std::set<_Key, _Compare, _Allocator>&) [with T = int*; Compare = std::less<int*>; Alloc = std::allocator<int*>]'
prog.cc:51:17:   required from here
prog.cc:21:21: error: no matching function for call to 'Read(Stream&, int*&)'
   21 |                 Read(s, elem);
      |                 ~~~~^~~~~~~~~
prog.cc:7:14: note: candidate: 'void Read(Stream&, size_t&)' <near match>
    7 |         void Read(Stream &, size_t &) {}
      |              ^~~~
prog.cc:7:14: note:   conversion of argument 2 would be ill-formed:
prog.cc:21:25: error: invalid conversion from 'std::set<int*>::value_type' {aka 'int*'} to 'size_t' {aka 'long unsigned int'} [-fpermissive]
   21 |                 Read(s, elem);
      |                         ^~~~
      |                         |
      |                         std::set<int*>::value_type {aka int*}
prog.cc:21:25: error: cannot bind rvalue '(size_t)elem' to 'size_t&' {aka 'long unsigned int&'}
prog.cc:8:14: note: candidate: 'void Read(Stream&, int&)' <near match>
    8 |         void Read(Stream &, int &) {}
      |              ^~~~
prog.cc:8:14: note:   conversion of argument 2 would be ill-formed:
prog.cc:21:25: error: invalid conversion from 'std::set<int*>::value_type' {aka 'int*'} to 'int' [-fpermissive]
   21 |                 Read(s, elem);
      |                         ^~~~
      |                         |
      |                         std::set<int*>::value_type {aka int*}
prog.cc:21:25: error: cannot bind rvalue '(int)elem' to 'int&'
prog.cc:28:14: note: candidate: 'template<class T, class Compare, class Alloc> void Read(Stream&, std::set<_Key, _Compare, _Allocator>&)'
   28 |         void Read(Stream & s, std::set<T, Compare, Alloc> & coll)
      |              ^~~~
prog.cc:28:14: note:   template argument deduction/substitution failed:
prog.cc:21:21: note:   mismatched types 'std::set<_Key, _Compare, _Allocator>' and 'std::set<int*>::value_type' {aka 'int*'}
   21 |                 Read(s, elem);
      |                 ~~~~^~~~~~~~~
Exit Code:
1