Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8463637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:30:42+00:00 2026-06-10T14:30:42+00:00

Instead of usual void foo (void ) { cout << Meaning of life: <<

  • 0

Instead of usual

void foo (void ) {
    cout << "Meaning of life: " << 42 << endl;
}

C++11 allows is an alternative, using the Trailing Return

auto bar (void) -> void {
    cout << "More meaning: " << 43 << endl;
}

In the latter – what is auto designed to represent?

Another example, consider function

auto func (int i) -> int (*)[10] {

}

Same question, what is the meaning of auto in this example?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T14:30:43+00:00Added an answer on June 10, 2026 at 2:30 pm

    In general, the new keyword auto in C++11 indicates that the type of the expression (in this case the return type of a function) should be inferred from the result of the expression, in this case, what occurs after the ->.

    Without it, the function would have no type (thus not being a function), and the compiler would end up confused.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Instead of using an interface like this: public interface IStartable { void Start(); void
I have my index page which posts a single entry instead of the usual
Instead of a clustered: - (void)objectLoader:(RKObjectLoader *)objectLoader didLoadObjects:(NSArray *)objects { if (objectLoader.method == RKRequestMethodGET)
private static void WriteJson(string filepath, string filename, JsonSchema jsonschema) { using (TextWriter writer =
Instead of the usual vertical table data layout something like this: I'd like to
I want to create google map using a pre-defined set of bounds. So instead
I recently came across classes that use a configuration object instead of the usual
I would like to have the navigation bar hide more slowly than usual. I
I want to sort the messages by poster_time instead of the usual id incrementing
Instead of using common OOP, like Java and C# do with their base class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.