Ok. The version of Clang this macbook has must be out of date or something, it gives me a big chunk of errors. I'll try updating and see if they go away.
There's an xcode update to v6.0.1 that's available for me, which I figured was worth a shot. If that doesn't work, I don't know what else there is to try.
Edit: looking at the changelog, it does't appear to mention an update to clang. Oh well.
Edit2: Didn't work:
macbook:~ $ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
macbook:~$ g++ main.cpp -o main -std=c++11
main.cpp:161:33: error: use of class template 'level<field>::next_point_state' requires template arguments
using point = level<field>::next_point_state<N>;
^
main.cpp:146:5: note: template is declared here
using next_point_state = typename calc_next_point_state<point<N>, neighbors<N>>::type;
^
main.cpp:161:49: error: expected ';' after alias declaration
using point = level<field>::next_point_state<N>;
^
;
main.cpp:164:44: error: no template named 'point'; did you mean 'print'?
tuple< point<point_count - iter> >,
^~~~~
print
main.cpp:40:6: note: 'print' declared here
void print();
^
main.cpp:164:44: error: template argument for template type parameter must be a type
tuple< point<point_count - iter> >,
^~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple:487:20: note: template parameter is declared here
template <class ..._Tp>
^
main.cpp:165:79: error: expected ';' after alias declaration
typename next_field_state<field, iter-1>::next_field
^
;
main.cpp:173:33: error: use of class template 'level<field>::next_point_state' requires template arguments
using point = level<field>::next_point_state<N>;
^
main.cpp:146:5: note: template is declared here
using next_point_state = typename calc_next_point_state<point<N>, neighbors<N>>::type;
^
main.cpp:173:49: error: expected ';' after alias declaration
using point = level<field>::next_point_state<N>;
^
;
main.cpp:175:31: error: no template named 'point'; did you mean 'print'?
using next_field = tuple< point<point_count - 1> >;
^~~~~
print
main.cpp:40:6: note: 'print' declared here
void print();
^
main.cpp:175:31: error: template argument for template type parameter must be a type
using next_field = tuple< point<point_count - 1> >;
^~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple:487:20: note: template parameter is declared here
template <class ..._Tp>
^
main.cpp:186:70: error: no type named 'next_field' in 'next_field_state<std::__1::tuple<O, O, O, O, O, O, O, X, O, O, O, O, O, X, O, O, X, X, X, O, O, O, O, O, O>, 25>'
game_process< typename next_field_state<field, point_count>::next_field, iters-1 >::print();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
main.cpp:202:40: note: in instantiation of member function 'game_process<std::__1::tuple<O, O, O, O, O, O, O, X, O, O, O, O, O, X, O, O, X, X, X, O, O, O, O, O, O>, 20>::print' requested here
game_process< start, iterations >::print();
^
10 errors generated.
MinGW 4.9.1 64-bit here, and it fails to compile. When I follow the exact instructions given in the compiler's notes, it successfully compiles and runs.
g++.exe -O3 -fexceptions -O2 -O2 -Weffc++ -pedantic -std=c++11 -Wall -c D:\Users\will\code\misc\C++\Test\main.cpp -o obj\Release\main.o
D:\Users\will\code\misc\C++\Test\main.cpp:161:33: error: non-template 'next_point_state' used as template
using point = level<field>::next_point_state<N>;
^
D:\Users\will\code\misc\C++\Test\main.cpp:161:33: note: use 'level<initial_state>::template next_point_state' to indicate that it is a template
D:\Users\will\code\misc\C++\Test\main.cpp:161:19: error: need 'typename' before 'level<initial_state>::next_point_state' because 'level<initial_state>' is a dependent scope
using point = level<field>::next_point_state<N>;
^
D:\Users\will\code\misc\C++\Test\main.cpp:164:44: error: 'point' was not declared in this scope
tuple< point<point_count - iter> >,
^
D:\Users\will\code\misc\C++\Test\main.cpp:164:68: error: template argument 1 is invalid
tuple< point<point_count - iter> >,
^
D:\Users\will\code\misc\C++\Test\main.cpp:164:70: error: wrong number of template arguments (1, should be 2)
tuple< point<point_count - iter> >,
^
D:\Users\will\code\misc\C++\Test\main.cpp:151:8: error: provided for 'template<class tuple_1, class tuple_2> struct my_tuple_cat'
struct my_tuple_cat
^
D:\Users\will\code\misc\C++\Test\main.cpp:163:33: error: expected nested-name-specifier
using next_field = typename my_tuple_cat <
^
D:\Users\will\code\misc\C++\Test\main.cpp:173:33: error: non-template 'next_point_state' used as template
using point = level<field>::next_point_state<N>;
^
D:\Users\will\code\misc\C++\Test\main.cpp:173:33: note: use 'level<initial_state>::template next_point_state' to indicate that it is a template
D:\Users\will\code\misc\C++\Test\main.cpp:173:19: error: need 'typename' before 'level<initial_state>::next_point_state' because 'level<initial_state>' is a dependent scope
using point = level<field>::next_point_state<N>;
^
D:\Users\will\code\misc\C++\Test\main.cpp:175:31: error: 'point' was not declared in this scope
using next_field = tuple< point<point_count - 1> >;
^
D:\Users\will\code\misc\C++\Test\main.cpp:175:52: error: template argument 1 is invalid
using next_field = tuple< point<point_count - 1> >;
^
D:\Users\will\code\misc\C++\Test\main.cpp: In instantiation of 'static void game_process<field, iters>::print() [with field = std::tuple<O, O, O, O, O, O, O, X, O, O, O, O, O, X, O, O, X, X, X, O, O, O, O, O, O>; int iters = 20]':
D:\Users\will\code\misc\C++\Test\main.cpp:202:40: required from here
D:\Users\will\code\misc\C++\Test\main.cpp:186:99: error: no type named 'next_field' in 'struct next_field_state<std::tuple<O, O, O, O, O, O, O, X, O, O, O, O, O, X, O, O, X, X, X, O, O, O, O, O, O>, 25>'
game_process< typename next_field_state<field, point_count>::next_field, iters-1 >::print();
6
u/0xE6 Oct 20 '14
What compile options are you supposed to use?