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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:42:12+00:00 2026-05-15T02:42:12+00:00

I’m porting over some templated code from Windows and I’m hitting some compiler differences

  • 0

I’m porting over some templated code from Windows and I’m hitting some compiler differences on the iPhone 3.2 SDK.

Original code inside a class template’s member function is:

return BinarySearch<uint32, CSimpleKey<T> >(key);

where BinarySearch is a method inherited from another template.

This produces the following error:

csimplekeytable.h:131: error: no matching function for call to 'BinarySearch(NEngine::uint32&)'

The visual studio compiler seems to walk up the template hierarchy fine but gcc needs me to fully qualify where the function comes from (I have verified this by fixing the same issues with template member variables that way).

So I now need to change this into:

return CSimpleTable<CSimpleKey<T> >::BinarySearch<uint32, CSimpleKey<T> >(key);

Which now produces the following error:

csimplekeytable.h:132: error: expected primary-expression before ',' token
csimplekeytable.h:132: error: expected primary-expression before '>' token

After some head scratching, I believe what’s going on here is that it’s trying to resolve the ‘<‘ before BinarySearch as a ‘Less Than’ operator for some reason.

So two questions:
– Am I on the right path with my interpretation of the error?
– How do I fix it?

-D

  • 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-15T02:42:13+00:00Added an answer on May 15, 2026 at 2:42 am

    If CSimpleTable is the base class, you need to qualify your call with that base class name or alternatively with this. But since both of these depend on the template parameters, the compiler cannot lookup what the name BinarySearch means. It could be a static integer constant, which you compare against something else, or it could be a template that you put arguments enclosed in <...> for. You need to tell the compiler about the latter

    /* the "::template" means: 'the name that follows is a template' */
    return CSimpleTable<CSimpleKey<T> >::template BinarySearch<uint32, CSimpleKey<T> >(key);
    

    Or with this

    return this->template BinarySearch<uint32, CSimpleKey<T> >(key);
    

    The reason for the qualification is that the compiler does not look for unqualified names in base classes that depend on template parameters (in your case the parameter is T), since the binding of the name would depend on whether the base class has such a name or not, which is considered unfortunate. For a plain name like BinarySearch, there is in addition no indication that this name depends on a template parameter, thus the Standard requires compilers not to delay lookup of the name until instantiation. So the name, even if lookup in dependent bases would be allowed on instantiation (which isn’t), couldn’t be found anyway.

    You have to explicitly tell the compiler to look in the enclosing class by qualifying it, in which event the compiler will include dependent base classes during lookup when instantiating. Prefixing with this or the class name will also make the name dependent, thus delaying lookup of it until instantiation. These two facts are required for it to work.

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.