回复 2楼 rjsp
我复制下来粘贴到我的code block里,编译报错了。。。
||=== Build file: "no target" in "no project" (compiler: unknown) ===|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|1|error: variable or field 'pour' declared void|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|1|error: 'size_t' was not declared in this scope|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|1|error: expected primary-expression before 'const'|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|1|error: expected primary-expression before 'const'|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|1|error: expected primary-expression before 'const'|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp||In function 'int main()':|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|9|error: 'pour' was not declared in this scope|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp||In function 'void pour(size_t, const unsigned int*, const unsigned int*, const unsigned int*)':|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|27|error: template argument for 'template<class> class std::allocator' uses local type 'pour(size_t, const unsigned int*, const unsigned int*, const unsigned int*)::foo'|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|27|error:
trying to instantiate 'template<class> class std::allocator'|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|27|error: template argument 2 is invalid|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|27|error: invalid type in declaration before '(' token|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|28|error: invalid types 'int[int]' for array subscript|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|29|error: invalid types 'int[int]' for array subscript|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|30|error: invalid types 'int[int]' for array subscript|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|31|error: invalid types 'int[int]' for array subscript|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|35|error: request for member 'size' in 'a', which is of non-class type 'int'|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|37|error: invalid types 'int[size_t {aka unsigned int}]' for array subscript|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|39|error: template argument for 'template<class> class std::allocator' uses local type 'pour(size_t, const unsigned int*, const unsigned int*, const unsigned int*)::foo*'|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|39|error:
trying to instantiate 'template<class> class std::allocator'|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|39|error: template argument 2 is invalid|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|39|error: invalid type in declaration before ';' token|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|40|error: invalid types 'int[size_t {aka unsigned int}]' for array subscript|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|41|error: request for member 'push_back' in 'ret', which is of non-class type 'int'|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|41|error: invalid types 'int[size_t {aka unsigned int}]' for array subscript|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|53|error: template argument for 'template<class> class std::allocator' uses local type 'pour(size_t, const unsigned int*, const unsigned int*, const unsigned int*)::foo*'|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|53|error:
trying to instantiate 'template<class> class std::allocator'|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|53|error: template argument 2 is invalid|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|53|error: invalid type in declaration before 'itor'|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|53|error: expected ';' before 'itor'|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|53|error: 'itor' was not declared in this scope|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|53|error: request for member 'rbegin' in 'ret', which is of non-class type 'int'|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|53|error: request for member 'rend' in 'ret', which is of non-class type 'int'|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|53|error: expected ')' before ';' token|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|53|error: 'itor' was not declared in this scope|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|64|error: invalid types 'int[size_t {aka unsigned int}]' for array subscript|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|66|error: invalid types 'int[size_t {aka unsigned int}]' for array subscript|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|68|error: invalid types 'int[size_t {aka unsigned int}]' for array subscript|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|68|error: invalid types 'int[size_t {aka unsigned int}]' for array subscript|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|70|error: invalid types 'int[size_t {aka unsigned int}]' for array subscript|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|84|error: request for member 'size' in 'a', which is of non-class type 'int'|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|85|error: invalid types 'int[size_t {aka unsigned int}]' for array subscript|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|89|error: request for member 'push_back' in 'a', which is of non-class type 'int'|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|90|error: request for member 'back' in 'a', which is of non-class type 'int'|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|91|error: request for member 'back' in 'a', which is of non-class type 'int'|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|92|error: request for member 'back' in 'a', which is of non-class type 'int'|
C:\Users\guokelu\Documents\code blocks\texe\daoshui.cpp|93|error: request for member 'back' in 'a', which is of non-class type 'int'|
||=== Build failed: 45 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|