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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:45:11+00:00 2026-05-20T01:45:11+00:00

I want to add a public typedef to a template for a pointer to

  • 0

I want to add a public typedef to a template for a pointer to a function-taking-one-argument that uses “C” language linkage.

I tried:

extern "C" {
    template <typename return_t_, typename arg1_t_>
    struct test
    {
        typedef return_t_ (*C_fun1_t)(arg1_t_);
    };
}

And:

template <typename return_t_, typename arg1_t_>
struct test
{
    extern "C" {
        typedef return_t_ (*C_fun1_t)(arg1_t_);
    }
};

And:

template <typename return_t_, typename arg1_t_>
struct test
{
    extern "C" typedef return_t_ (*C_fun1_t)(arg1_t_);
};

without success.

Is what I am trying to accomplish possible?

  • 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-20T01:45:11+00:00Added an answer on May 20, 2026 at 1:45 am

    C++03, §7.5p4:

    A linkage-specification shall occur only in namespace scope. … A C language linkage is ignored for the names of class members and the member function type of class member functions.

    Unfortunately, you simply can’t do this in current C++. This text is unchanged in the latest C++0x draft, but “template typedefs” may be able to accomplish it.

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

Sidebar

Related Questions

if I want to add something to the implementation of public static function createPopUp(parent:DisplayObject,
I have a list of string values that I want add to a hashtable
I want add a logger function to a worker class, how to pass a
I want to add a operator override to perform assignments /__set__s inline. Template :-
Scenario: we already have a Document model, and we want to add public private
I have class method: public object MyMethod(object obj) { // I want to add
I want to add Japan's Tsunami donation message for general public visiting my site.
in the ModelStateDictionary class there are only AddModelError and Add function , i want
I want to add my user control in InstantiateIn like this: public void InstantiateIn(Control
In the public folder we have stylesheets, javascripts and images. I want to add

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.