CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: superbonzo

Search: Search took 1.48 seconds.

  1. Replies
    4
    Views
    1,311

    Re: get return type of function

    the easiest way is to write a trait class



    template <class T>
    struct grad_type {};

    template <>
    struct grad_type<Scalar> { typedef Vector type; };
  2. Replies
    4
    Views
    1,311

    Re: get return type of function

    in c++11, you can simply write

    "auto Y = grad(x);"
    "auto const& Y = grad(x);"
    ...

    or

    "typedef decltype(grad(x)) GradType;
Results 1 to 2 of 2





Click Here to Expand Forum to Full Width

Featured