Skip to main content This browser is no longer supported. Show
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support. decltype (C++)
In this articleThe Syntax
Parameters
Return valueThe type of the RemarksThe The compiler uses the following rules to determine the type of the
The following code example demonstrates some uses of the
Next, examine the types that are returned by the four
decltype and autoIn C++14, you can use In C++11, you can use the
The introduction of the The following prototype illustrates the syntax of an alternative function declaration. The
In the following code example, the
late-specified return type of the
decltype and forwarding functions (C++11)Forwarding functions wrap calls to other functions. Consider a function template that forwards its arguments, or the results of an expression that involves those arguments, to another function. Furthermore, the forwarding function returns the result of calling the other function. In this scenario, the return type of the forwarding function should be the same as the return type of the wrapped function. In this scenario, you can't write an appropriate type expression without the ExamplesThe following code example declares the
late-specified return type of function template
Visual Studio 2017 and later: The compiler parses The following example shows such a compiler error that is raised at the point of declaration:
RequirementsVisual Studio 2010 or later versions.
FeedbackSubmit and view feedback for What is a module that returns a value back to the part of the program that called it?A value-returning function is a function that returns a value back to the part of the program that called it.
Which of the following is optional when writing a function definition quizlet?The parameter list that accepts arguments is optional in a function definition.
Which of the following error occurs when a real value is attempted to be assigned to an integer variable?The Overflow error occurs when a variable is assigned a value it cannot contain. This typically relates to Integer variables, which can only hold values up to 32767. If a value such as 40000 is assigned to an Integer, an Overflow error will occur.
Which function returns a string within a string?The function strstr returns the first occurrence of a string in another string. This means that strstr can be used to detect whether a string contains another string.
|