• 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
Re: C++ templates: no support for 'export' ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ templates: no support for 'export' ?


  • Subject: Re: C++ templates: no support for 'export' ?
  • From: Paul Walmsley <email@hidden>
  • Date: Mon, 31 Mar 2008 09:26:50 +0100

Dan Caugherty wrote:
What other source code organization strategies can I try, other than (gag)
sticking all of my class methods in the header?
If you have large template methods in your header then it may be worth seeing if there are large chunks of it that aren't dependent on the templated class, that you could move into a separate concrete class or function. I've also come across cases where there has been a lot of duplicated templated code because one function defines an operation for vectors, one does it for lists, etc. In this case, rewriting the interfaces to use either iterators or creating a 'container' template would remove lots of duplication.

There are many other strategies such as trying to convert the templated code to use class hierarchies and function overloading, or using type traits to control type-specific behaviour.

The key question to ask is: how does the behaviour of my templated code depend on the templated type? Then try to extract all the stuff that doesn't vary at all.

Paul
_______________________________________________
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


References: 
 >C++ templates: no support for 'export' ? (From: Dan Caugherty <email@hidden>)

  • Prev by Date: Re: Wrong Frameworks Build Configuration Copied to App Pkg
  • Next by Date: Re: C++ templates: no support for 'export' ?
  • Previous by thread: Re: C++ templates: no support for 'export' ?
  • Next by thread: release version not compiling
  • Index(es):
    • Date
    • Thread