c++11 - How to implement templated function with "subtemplated" -
After
I have a function which is declaration
in the template's & lt; Typename t & gt; T obtained (int x);
What do I want to achieve is a version where the return type is to apply a templated square (aka chrono :: time_point)
I tried < / P> but it does not match with the announcement. What is the proper way to do this? Templates & lt; Typename clock & gt; Std :: chrono :: time_point & lt; Clock & gt; Find (int x) {// execution}
You may not be partially expert of the function.
You can do a function template through a special property / function object class, which you want.
Namespace Details {Template & lt; Class T & gt; Get the structure {T operator () (int x) {// code}}; Template & lt; Class Watch & gt; Get structure & lt; Std :: chrono :: time_point & lt; Clock & gt; & Gt; {T = std :: chrono :: time_point & lt; Clock & gt; T operator () (int x) {// code}}; } Template & lt; Square T & gt; T obtained (int x) {return statement :: get & lt; T & gt; {} (X); }
Comments
Post a Comment