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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:12:54+00:00 2026-06-14T18:12:54+00:00

What are the existing rules for taking function pointers or member function pointers to

  • 0

What are the existing rules for taking function pointers or member function pointers to Standard functions? For example, something like

auto p = &std::string::size;

Is this legal? Would it be more or less legal if I explicitly requested the correct type, so it would function even if there was an additional implementation-added overload of std::string::size?

  • 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-14T18:12:55+00:00Added an answer on June 14, 2026 at 6:12 pm

    Using the “correct” type doesn’t make things better: Except for the virtual functions all functions in the standard C++ library can have additional arguments as long as these are defaulted. Since the functions can also be declared with additional overloads (again with the exception of the virtual function), you can end up trying to assign an overload set a variable. Thus, the code isn’t portable and there is no way to make it portable by using some sort of cast or some signature instead of auto.

    The relevant quote is 17.6.5.5 [member.functions] paragraph 1:

    An implementation may declare additional non-virtual member function signatures within a class:
    — by adding arguments with default values to a member function signature;
    — by replacing a member function signature with default values by two or more member function signatures with equivalent behavior; and
    — by adding a member function signature for a member function name.

    I don’t see a similar permission for non-member functions, though. Not sure where the permission to mess with these is hiding but I’m relatively sure that there are some weasel words for these as well. Looking further, it seems non-member functions are more constrained according to 17.6.5.4 [global.functions] paragraph 3:

    An implementation shall not declare a global or non-member function signature with additional default arguments.

    This would imply that you can take the address of the non-member functions, at least, when specifying the desired signature.

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

Sidebar

Related Questions

My existing xml file looks like <transaction> <id> <in>computer</in> <sn>1234567</sn> <book>JAVA</book> <author>klen</author> </id> <data>
I have an existing java/scala application using a global thread pool. I would like
I have an existing site built with CodeIgniter at example.com. I have a WordPress
I'm simply adding to a set of rules on existing rewrite rules for our
Is there a pre-existing function or class for URL normalization in PHP? Specifically, following
Existing XML webservice Processes XML-RPC style requests in which an operation element which identifies
Existing markup: <g:textField name=identifier/> <g:remoteLink action=newId update=identifier>generate new id</g:remoteLink> Corresponding HTML markup: <input type=text
Reading existing code at work, I wondered how come this could work. I have
An existing DB schema has unique, non-primary, keys, and some foreign keys that rely
I'm porting an existing app to rails that makes extensive use of stylized anchors

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.