Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

about 5 years ago

Language

C++

Compiler

gcc HEAD 11.0.0 20201201 (experimental)

Options
Warnings
Boost 1.73.0
C++2a(GNU)
no pedantic

Author

anonymous

about 5 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=gnu++2a
prog.cc: In instantiation of 'struct DotProductT<int, 3>':
prog.cc:25:37:   required from 'auto DotProduct(const std::array<_Tp, _Nm>&, const std::array<_Tp, _Nm>&) [with T = int; long unsigned int N = 3]'
prog.cc:31:36:   required from here
prog.cc:6:54: error: invalid type argument of unary '*' (have 'int')
    6 |     static inline auto Result(T a, T b) -> decltype (*a * *b)
      |                                                      ^~
prog.cc:6:59: error: invalid type argument of unary '*' (have 'int')
    6 |     static inline auto Result(T a, T b) -> decltype (*a * *b)
      |                                                           ^~
prog.cc: In instantiation of 'auto DotProduct(const std::array<_Tp, _Nm>&, const std::array<_Tp, _Nm>&) [with T = int; long unsigned int N = 3]':
prog.cc:31:36:   required from here
prog.cc:25:37: error: 'Result' is not a member of 'DotProductT<int, 3>'
   25 |     return DotProductT<T, N>::Result(x.begin(), y.begin());
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
Exit Code:
1