• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
C++ : "is not derived from type"..
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C++ : "is not derived from type"..


  • Subject: C++ : "is not derived from type"..
  • From: Dan Caugherty <email@hidden>
  • Date: Tue, 20 Oct 2009 22:08:48 -0400

Hey all --

This is more of a C++ question than anything else, but I'm not sure
why I'm seeing an error in this case.
I'm trying to use the linkage<> template below like a traits class
definition, but for some reason, the final
class template definition's scope doesn't seem to include it. Why?

typedef unsigned int function_return_type;
typedef function_return_type (*cpp_function_type)(...);
extern "C" {
   typedef function_return_type (*c_function_type)();
}

template <bool IsCPP> class linkage;

template <>
class linkage<true> {
public:
  typedef cpp_function_type function_type;
};

template <>
class linkage<false> {
public:
  typedef c_function_type function_type;
};


template < bool IsCPP = true >
class call_some_function {
public:
  typedef linkage<IsCPP>::function_type function_type; //ERROR:
call_some_function<IsCPP> is not derived from type linkage<IsCPP>
};


This is probably something very obvious, but it's eluding me. Anyone know?

Thanks,
-- Dan Caugherty
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: C++ : "is not derived from type"..
      • From: Steve Checkoway <email@hidden>
  • Prev by Date: Re: [boost] linking on OSX
  • Next by Date: Re: [boost] linking on OSX
  • Previous by thread: Re: Codesense broken?
  • Next by thread: Re: C++ : "is not derived from type"..
  • Index(es):
    • Date
    • Thread