Error Complex Is Not A Template
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about is not a template type c++ Stack Overflow the company Business Learn more about hiring developers or posting ads with
How To Forward Declare A Template Class
us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a gcc is not a class template community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Why is complex
Is Not A Type Error C++
The C++ program #include
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings
Is Is Not Analysis
and policies of this site About Us Learn more about Stack Overflow
Friend Template Class
the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation c++ template example Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it http://stackoverflow.com/questions/1641819/why-is-complexdouble-int-not-defined-in-c only takes a minute: Sign up Error: some class is not a template up vote 1 down vote favorite I have a header file Algo.h. It has the following content: #include
library Containers library Algorithms library Iterators library Numerics library Input/output library Localizations library Regular expressions library (C++11) http://en.cppreference.com/w/cpp/numeric/complex Atomic operations library (C++11) Thread support library (C++11) Filesystem library (C++17) Technical Specifications [edit] Numerics library Common mathematical functions Special mathematical functions Floating-point environment http://www.cplusplus.com/forum/unices/183536/ (C++11) Complex numbers Numeric arrays Pseudo-random number generation Compile-time rational arithmetic (C++11) Numeric algorithms gcd(C++17) lcm(C++17) Generic numeric operations iota(C++11) accumulate inner_product adjacent_difference partial_sum is not [edit]std::complex Member functions complex::complex complex::operator= complex::real complex::imag complex::operator+=complex::operator-=complex::operator*=complex::operator/= Non-member functions operator+operator- operator+operator-operator*operator/ operator==operator!= operator<
NN,complex TotFourierTransf[][NN],complex GaussLegTransf[][NN], PhiLimits phiBounds) { Errors: 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
g++ -std=c++14 sphere_perspective.cpp sphere_perspective.cpp:551:70: error: use of parameter outside function body before ‘]’ token public : void legendreTransform (int NN,complex TotFourierTransf[NN][NN],complex GaussLegTransf[NN][NN], ^ sphere_perspective.cpp:551:74: error: use of parameter outside function body before ‘]’ token public : void legendreTransform (int NN,complex TotFourierTransf[NN][NN],complex GaussLegTransf[NN][NN], ^ sphere_perspective.cpp:551:75: error: expected ‘)’ before ‘,’ token public : void legendreTransform (int NN,complex TotFourierTransf[NN][NN],complex GaussLegTransf[NN][NN], ^ sphere_perspective.cpp:551:76: error: variable or field ‘complex’ declared void public : void legendreTransform (int NN,complex TotFourierTransf[NN][NN],complex GaussLegTransf[NN][NN], ^ sphere_perspective.cpp:551:76: error: expected ‘;’ at end of member declaration sphere_perspective.cpp:551:84: error: ‘GaussLegTransf’ does not name a type public : void legendreTransform (int NN,complex TotFourierTransf[NN][NN],complex GaussLegTransf[NN][NN], ^ Why? Thanks, - Alex Last edited on Jan 29, 2016 at 9:43pm UTC Jan 29, 2016 at 10:07pm UTC Zhuge (4639) Try using a different name for your formal parameter NN, as it seems to be identical to the size of the array you are using for the other parameters. Jan 29, 2016 at 11:57pm UTC alexBB (103) Thank you Zhuge. This is the result: 1
2
3
4
5
6
7
8
9
10
11
12
13
14
g++ -std=c++14 sphere_perspective.cpp