c++ - What is "using" doing in this instance, and what is being stored? -


i have following class:

class foo{  }  class bar{ public:       using meth = foo* (*)(int a, std::string b); } 

can explain line means:

     using meth = foo* (*)(int a, std::string b); 

it seems me way of storing pointer constructor or something. if can explain, appreciate it.

please feel free edit question make more descriptive - if knew code did, wouldn't ask question.

the line

using meth = foo* (*)(int a, std::string b); 

makes meth shorthand (type alias) lengthy function pointer type declaration.

it can used like:

foo* bar(int a, std::string b);  meth baz = bar; 

Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -