Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

329
Views
C++ lambda function with no argument return 1

I was writing simple C++ program, while using lambda function, and I got into this situation

std::cout << [](int x = 10) -> int { return (x + 5); } << std::endl; // prints 1

I expected, with no passing argument, this lambda function would return 15, therefore printed result would be 15.

But above lambda function returns 1 instead. Does it mean that the lambda function just worked correctly? Is is some kind of flag value?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!