1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
vec_div.cpp:7:7: error: expected nested-name-specifier before ‘vector_2’
using vector_2 = std::vector< std::vector<double> > ;
^
vec_div.cpp: In function ‘std::vector<double> divide(const std::vector<double>&, const std::vector<double>&)’:
vec_div.cpp:14:21: error: ‘begin’ is not a member of ‘std’
std::transform( std::begin(a), std::begin(a)+n, std::begin(b),
^
vec_div.cpp:14:36: error: ‘begin’ is not a member of ‘std’
std::transform( std::begin(a), std::begin(a)+n, std::begin(b),
^
vec_div.cpp:14:53: error: ‘begin’ is not a member of ‘std’
std::transform( std::begin(a), std::begin(a)+n, std::begin(b),
^
vec_div.cpp:15:62: error: wrong number of template arguments (0, should be 1)
std::back_inserter(result), std::divides<>{} ) ;
^
In file included from /usr/include/c++/5/string:48:0,
from /usr/include/c++/5/bits/locale_classes.h:40,
from /usr/include/c++/5/bits/ios_base.h:41,
from /usr/include/c++/5/ios:42,
from /usr/include/c++/5/ostream:38,
from /usr/include/c++/5/iostream:39,
from vec_div.cpp:1:
/usr/include/c++/5/bits/stl_function.h:197:12: note: provided for ‘template<class _Tp> struct std::divides’
struct divides : public binary_function<_Tp, _Tp, _Tp>
^
vec_div.cpp:15:63: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
std::back_inserter(result), std::divides<>{} ) ;
^
vec_div.cpp: At global scope:
vec_div.cpp:19:1: error: ‘vector_2’ does not name a type
vector_2 divide( const vector_2& a, const vector_2& b )
^
vec_div.cpp: In function ‘int main()’:
vec_div.cpp:31:11: error: ‘vector_2’ does not name a type
const vector_2 a { {1,2,3}, {4,5}, {}, {6,7,8,9} } ;
^
vec_div.cpp:32:11: error: ‘vector_2’ does not name a type
const vector_2 b { {9,8,7}, {6,5}, {}, {4,3,2,1} } ;
^
vec_div.cpp:34:16: error: ‘c’ does not name a type
const auto c = divide( a, b ) ;
^
vec_div.cpp:35:22: error: ISO C++ forbids declaration of ‘vec’ with no type [-fpermissive]
for( const auto& vec : c )
^
vec_div.cpp:35:28: warning: range-based ‘for’ loops only available with -std=c++11 or -std=gnu++11
for( const auto& vec : c )
^
vec_div.cpp:35:28: error: ‘c’ was not declared in this scope
vec_div.cpp:38:25: warning: range-based ‘for’ loops only available with -std=c++11 or -std=gnu++11
for( double d : vec ) std::cout << std::fixed << d << ' ' ;
|