locked
task::then method questions

    Question

  • Hi all,

     As defined in http://msdn.microsoft.com/en-US/library/windows/apps/hh750044

    template<
       typename _Function
    >
    auto then(
       const _Function& _Func
    ) const -> typename details;

    Could anybody help explain:

    (1) what "->" means here, does it mean "return value"?

    (2)what does "details" mean? 

    (3)does "task::then" method return "auto" type? or return "typename" type? 


    Qiusheng Xie

    Tuesday, May 29, 2012 12:46 PM

Answers

  • Hi Quisheng,

    This is standard C++ syntax. Please see Lambda Expressions in C++ for more details.

    -> indicates the return type of a lambda function.

    auto is not itself a type: auto is a keyword which requests that the compiler determine the type from the expression which is assigned to the variable. See auto keyword.

    --Rob

    • Marked as answer by Qiusheng Xie Wednesday, May 30, 2012 1:47 AM
    Tuesday, May 29, 2012 4:50 PM
    Owner

All replies

  • Hi Quisheng,

    This is standard C++ syntax. Please see Lambda Expressions in C++ for more details.

    -> indicates the return type of a lambda function.

    auto is not itself a type: auto is a keyword which requests that the compiler determine the type from the expression which is assigned to the variable. See auto keyword.

    --Rob

    • Marked as answer by Qiusheng Xie Wednesday, May 30, 2012 1:47 AM
    Tuesday, May 29, 2012 4:50 PM
    Owner
  • Thanks Rob

    Qiusheng Xie

    Wednesday, May 30, 2012 1:47 AM