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 8357423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:28:16+00:00 2026-06-09T10:28:16+00:00

Here: http://en.cppreference.com/w/cpp/utility/functional/function operator bool is described: Checks whether the stored callable object is valid.

  • 0

Here:

http://en.cppreference.com/w/cpp/utility/functional/function

operator bool is described: “Checks whether the stored callable object is valid”.

Presumably a default constructed std::function is not valid but is this the only case?

Also, how does it check whether it is valid?

Is the case where operator() raises std::bad_function_call exactly the case where the object is not valid?

  • 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-09T10:28:17+00:00Added an answer on June 9, 2026 at 10:28 am

    It’s poorly written as is, your confusion is justified. By “valid” they mean “has a target”.

    A std::function “has a target” when it’s been assigned a function:

    std::function<void()> x; // no target
    std::function<void()> y = some_void_function; // has target
    
    x = some_other_void_function; // has target
    y = nullptr; // no target
    
    x = y; // no target
    

    They should have either defined “valid” before they used it, or simply stuck with the official wording.

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

Sidebar

Related Questions

Here: http://download.oracle.com/docs/html/A95907_01/diff_uni.htm#1077398 I found that on Windows Oracle is thread based, while on Unix
See here http://www.hanselman.com/blog/InSearchOfThePerfectMonospacedProgrammersFontInconsolata.aspx - for want of a better description - the statement block
Example here: http://jezebel.com/5896408/racist-hunger-games-fans-dont-care-how-much-money-the-movie-made Click on the 3x3 Tweets screencap they have up. I love
here http://www.codeproject.com/KB/database/CsvReader.aspx offers both source and binary files. If I am a programmer who
I saw an article here: http://code.lancepollard.com/automatically-publish-posts-to-stumbleupon-with-ruby I don't know Ruby, but the following lines
The plugin posted in here: http://www.tutcity.com/javascript/jquery-mousehold-event.27019.htm is a JQuery plugin meant to listen for
From here: http://www.codingwithoutcomments.com/ If you do use Singletons, try to use dependency injection instead
Test here: http://jsperf.com/test-for-speed-of-various-conditionals I'm interested if others are getting the same results, and what
I follow the tutorial here http://blog.bdoughan.com/2011/05/jaxb-and-joda-time-dates-and-times.html to use joda DateTime with jersey. But I
As stated here : http://codeigniter.com/user_guide/general/cli.html A page like : http://www.example.com/myController/myFunc/myParam can be run on

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.