Skip to content

Instantly share code, notes, and snippets.

@koo5
Created March 20, 2014 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koo5/9655444 to your computer and use it in GitHub Desktop.
Save koo5/9655444 to your computer and use it in GitHub Desktop.
kook@kook:~/test$ clang++ -std=c++11 ode.cpp
ode.cpp:22:29: error: declaration of 'functor_type' shadows template parameter
template <typename functor_type> class Container1,
^
ode.cpp:20:19: note: template parameter is declared here
template<typename functor_type,
^
ode.cpp:23:29: error: declaration of 'coord_type' shadows template parameter
template <typename coord_type> class Container2,
^
ode.cpp:21:19: note: template parameter is declared here
typename coord_type,
^
ode.cpp:35:29: error: declaration of 'T' shadows template parameter
template <typename T> class Container1,
^
ode.cpp:33:19: note: template parameter is declared here
template<typename T,
^
ode.cpp:36:29: error: declaration of 'coord_type' shadows template parameter
template <typename coord_type> class Container2 >
^
ode.cpp:34:19: note: template parameter is declared here
typename coord_type,
^
ode.cpp:45:29: error: declaration of 'T' shadows template parameter
template <typename T> class Container1,
^
ode.cpp:43:19: note: template parameter is declared here
template<typename T,
^
ode.cpp:46:29: error: declaration of 'coord_type' shadows template parameter
template <typename coord_type> class Container2 >
^
ode.cpp:44:19: note: template parameter is declared here
typename coord_type,
^
ode.cpp:59:29: error: declaration of 'functor_type' shadows template parameter
template <typename functor_type> class Container1,
^
ode.cpp:57:19: note: template parameter is declared here
template<typename functor_type,
^
ode.cpp:60:29: error: declaration of 'coord_type' shadows template parameter
template <typename coord_type> class Container2,
^
ode.cpp:58:19: note: template parameter is declared here
typename coord_type,
^
ode.cpp:102:18: error: no matching function for call to 'crk4'
auto vec_n = crk4(f_vec.begin(),f_vec.end(),coords.begin(),coords.end(),t0,step_size);
^~~~
ode.cpp:63:1: note: candidate template ignored: couldn't infer template argument 'functor_type'
crk4(class Container1<functor_type>::iterator funct_iter1,
^
ode.cpp:114:29: error: declaration of 'functor_type' shadows template parameter
template <typename functor_type> class Container1,
^
ode.cpp:112:19: note: template parameter is declared here
template<typename functor_type,
^
ode.cpp:115:29: error: declaration of 'coord_type' shadows template parameter
template <typename coord_type> class Container2,
^
ode.cpp:113:19: note: template parameter is declared here
typename coord_type,
^
ode.cpp:136:29: error: declaration of 'T' shadows template parameter
template <typename T> class Container1,
^
ode.cpp:134:19: note: template parameter is declared here
template<typename T,
^
ode.cpp:137:29: error: declaration of 'coord_type' shadows template parameter
template <typename coord_type> class Container2>
^
ode.cpp:135:19: note: template parameter is declared here
typename coord_type,
^
ode.cpp:155:29: error: declaration of 'T' shadows template parameter
template <typename T> class Container1,
^
ode.cpp:153:19: note: template parameter is declared here
template<typename T,
^
ode.cpp:156:29: error: declaration of 'coord_type' shadows template parameter
template <typename coord_type> class Container2 >
^
ode.cpp:154:19: note: template parameter is declared here
typename coord_type,
^
ode.cpp:178:29: error: declaration of 'functor_type' shadows template parameter
template <typename functor_type> class Container1,
^
ode.cpp:176:19: note: template parameter is declared here
template<typename functor_type,
^
ode.cpp:179:29: error: declaration of 'coord_type' shadows template parameter
template <typename coord_type> class Container2,
^
ode.cpp:177:19: note: template parameter is declared here
typename coord_type,
^
17 errors generated.
kook@kook:~/test$ gcc -std=c++11 ode.cpp
ode.cpp: In function ‘int main(int, char**)’:
ode.cpp:102:89: error: no matching function for call to ‘crk4(std::vector<std::function<double(__gnu_cxx::__normal_iterator<double*, std::vector<double> >, __gnu_cxx::__normal_iterator<double*, std::vector<double> >, double)> >::iterator, std::vector<std::function<double(__gnu_cxx::__normal_iterator<double*, std::vector<double> >, __gnu_cxx::__normal_iterator<double*, std::vector<double> >, double)> >::iterator, std::vector<double>::iterator, std::vector<double>::iterator, double&, double&)’
auto vec_n = crk4(f_vec.begin(),f_vec.end(),coords.begin(),coords.end(),t0,step_size);
^
ode.cpp:102:89: note: candidate is:
ode.cpp:63:1: note: template<class functor_type, class coord_type, template<class functor_type> class Container1, template<class coord_type> class Container2, class t_type> std::vector<double> crk4(class Container1<functor_type>::iterator, class Container1<functor_type>::iterator, class Container2<coord_type>::iterator, class Container2<coord_type>::iterator, t_type, double)
crk4(class Container1<functor_type>::iterator funct_iter1,
^
ode.cpp:63:1: note: template argument deduction/substitution failed:
ode.cpp:102:89: note: couldn't deduce template parameter ‘functor_type’
auto vec_n = crk4(f_vec.begin(),f_vec.end(),coords.begin(),coords.end(),t0,step_size);
^
ode.cpp:104:23: error: unable to deduce ‘auto&&’ from ‘vec_n’
for(const auto& i:vec_n)
^
kook@kook:~/test$
kook@kook:~/test$
kook@kook:~/test$
kook@kook:~/test$ clang -v
Debian clang version 3.2-7ubuntu1 (tags/RELEASE_32/final) (based on LLVM 3.2)
Target: i386-pc-linux-gnu
Thread model: posix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment