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

  • Home
  • SEARCH
  • 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 6711963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:12:14+00:00 2026-05-26T08:12:14+00:00

Is this valid under the recently updated standard? auto main = [](int argc, char*

  • 0

Is this valid under the recently updated standard?

auto main = [](int argc, char* argv[]) -> int
{
    return 0;
};

My best guess is that it depends on whether main() MUST be a function, or if it is allowed to be any globally scoped symbol that is callable (with ()).

  • 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-05-26T08:12:15+00:00Added an answer on May 26, 2026 at 8:12 am

    No, and here’s why:

    [n3290: 3.6.1/1]: A program shall contain a global function called
    main
    , which is the designated start of the program. It is
    implementation-defined whether a program in a freestanding environment
    is required to define a main function. [ Note: In a freestanding
    environment, start-up and termination is implementation-defined;
    startup contains the execution of constructors for objects of
    namespace scope with static storage duration; termination contains the
    execution of destructors for objects with static storage duration.
    —end note ]

    Lambdas are not functions, but function objects or functors:

    [n3290: 5.1.2/3]: The type of the lambda-expression (which is
    also the type of the closure object) is a unique, unnamed nonunion
    class type — called the closure type — whose properties are described below. [..]

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

Sidebar

Related Questions

I was under the impression this is valid SQLite syntax: SELECT *, (SELECT amount
Apparently, this call to window.open is not valid under Internet Explorer. The Javascript code
Is this valid?: http://www.SomeURL.com/Index.php?123=xyz Will I be able to access the value 'xyz' under
Is this valid and correct? RewriteRule ^myOldPage.html$ /index.php#info [R] I'm specifically interested about the
Is this valid: $_SESSION['pictures']['rateAlbum']['_POST'] = $_POST; I want to save all of the POST
Is this valid C++ (e.g. not invoking UB) and does it achieve what I
As you know the dash introduces a comment how can I make this valid?
Quick question, how can I make this valid : if($this->datos->bathrooms == 1½){$select1 = JText::_(
When this is valid: string s4 = H e l l o; string[] arr
Is this a valid jQuery syntax :$('#id')[0];

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.