Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 7 years ago

Language

C++

Compiler

gcc 4.9.0

Options
Warnings
Boost 1.64.0
C++14(GNU)
no pedantic

Author

anonymous

almost 7 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.64.0/gcc-4.9.0/include -std=gnu++14
prog.cc:2:14: error: 'vector' in namespace 'std' does not name a template type
  static std::vector<T> generate_random(size_t count,
              ^
prog.cc:16:29: error: 'enable_if' in namespace 'std' does not name a template type
    typename = typename std::enable_if<std::is_arithmetic<T>::value>::type>
                             ^
prog.cc:16:38: error: expected '>' before '<' token
    typename = typename std::enable_if<std::is_arithmetic<T>::value>::type>
                                      ^
prog.cc:18:44: error: 'conditional' in namespace 'std' does not name a template type
    using distribution_type = typename std::conditional<
                                            ^
prog.cc:24:9: error: 'default_random_engine' in namespace 'std' does not name a type
    std::default_random_engine engine;
         ^
prog.cc:25:4: error: 'distribution_type' does not name a type
    distribution_type distribution;
    ^
prog.cc:32:48: error: 'engine' was not declared in this scope
     auto operator()() -> decltype(distribution(engine)) 
                                                ^
prog.cc:32:54: error: there are no arguments to 'distribution' that depend on a template parameter, so a declaration of 'distribution' must be available [-fpermissive]
     auto operator()() -> decltype(distribution(engine)) 
                                                      ^
prog.cc:32:54: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
prog.cc:32:48: error: 'engine' was not declared in this scope
     auto operator()() -> decltype(distribution(engine)) 
                                                ^
prog.cc:32:54: error: there are no arguments to 'distribution' that depend on a template parameter, so a declaration of 'distribution' must be available [-fpermissive]
     auto operator()() -> decltype(distribution(engine)) 
                                                      ^
prog.cc: In constructor 'internal::random_generator<T, <template-parameter-1-2> >::random_generator(T, T)':
prog.cc:28:37: error: class 'internal::random_generator<T, <template-parameter-1-2> >' does not have any field named 'distribution'
     random_generator(T min, T max) :distribution(min, max)
                                     ^
prog.cc: In member function 'decltype (distribution(<expression error>)) internal::random_generator<T, <template-parameter-1-2> >::operator()()':
prog.cc:34:26: error: 'engine' was not declared in this scope
      return distribution(engine);
                          ^
prog.cc:34:32: error: there are no arguments to 'distribution' that depend on a template parameter, so a declaration of 'distribution' must be available [-fpermissive]
      return distribution(engine);
                                ^
prog.cc: At global scope:
prog.cc:40:21: error: 'decay' in namespace 'std' does not name a template type
    -> typename std::decay<decltype(std::declval<random_generator<T>>())>::type
                     ^
prog.cc:40:26: error: expected initializer before '<' token
    -> typename std::decay<decltype(std::declval<random_generator<T>>())>::type
                          ^
Exit Code:
1