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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:37:48+00:00 2026-06-04T23:37:48+00:00

Assume I have struct X { ~X() {} }; What’s the type of and

  • 0

Assume I have

struct X {
  ~X() {}
};

What’s the type of and how do I get the member function pointer of X::~X() in C++03?

I don’t want to actually call it, just use in SFINAE to figure if there exists a destructor for a given type.

  • 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-04T23:37:49+00:00Added an answer on June 4, 2026 at 11:37 pm

    You can’t get the function pointer of a destructor nor a constructor. Nevertheless a destructor always exist for a type, and you can’t detect if its private with as access specifiers are not considered by SFINAE.

    On the subject of invoking what would be the destructor of a scalar type, the standard says [class.dtor]/16:

    [Note:the notation for explicit call of a destructor can be used for any scalar type name (5.2.4). Allowing this makes it possible to write code without having to know if a destructor exists for a given type. For example,

    typedef int I;

    I* p;

    p->I::~I();

    —end note]

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

Sidebar

Related Questions

So, assume I have a template structure-function fib<i>::value . I want to get nth
Assume I have an enumerable object enum and now I want to get the
Assume that we have that struct X; and we use C++11 compiler (e.g. gcc
Assume I have the following exemplary function: template <typename Fn> auto call(Fn fn) ->
Say I have a struct s with an int pointer member variable i. I
Assume you have a type like the following: struct Value(int v_) { static const
Assume I have two tables, Student Test Id Name TestId Type StudentId -- ----
Assume you have a function read_key and normally it does some stuff. You someone
Lets assume I have a structure: struct A { uint16_t a; uint64_t b; };
Assume I have some templated class template <typename T> struct Dummy { // ...

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.