Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by DanRosenberry

  1. DanRosenberry

    Gcc templates instantiation

    Here's gcc's page on how they do template instantiation. http://gcc.gnu.org/onlinedocs/gcc-3.2.2/gcc/Template-Instantiation.html I personally would love to have definitions in something other than a .h, as it seems wrong. Stroustrup in "The Design and Evolution of C++" concurs on...
  2. DanRosenberry

    Template instantiation with gcc

    There are some caveats though. You have to wrap all types that go into/out of your secret code. If you have a need to construct values of user based types (template arguments), you'll need to add hooks for delegated instantiation. You'll likely run into the fact that gcc loves to give errors...
  3. DanRosenberry

    Template instantiation with gcc

    /* this is the way that hides your code. the namespace * SecretLogger can be defined in any linked file. Wrapped * also acts like a constraint on the Logger template as * only the functions declared there are available in your * hidden code */ #include <iostream> #include <string> class...
  4. DanRosenberry

    Template instantiation with gcc

    /* * This is the normal way of doing things, all in a header. * Even if YOU can get around it, your clients can't if they * use gcc */ #include <iostream> #include <string> template< class SomeT > class Logger { public: bool log(const SomeT& a_problem); }; template< class SomeT...
  5. DanRosenberry

    Template instantiation with gcc

    /* here's the main code that I used unchanged for both of the following code structures */ #include <iostream> #include <string> /* I changed this line to a different header but no other changes to this file */ #include &quot;sample3.hh&quot; class myImpl : public std::string { public...
  6. DanRosenberry

    Template instantiation with gcc

    There are ways to work around this. However, consider the following questions 1) If you don't share a definition of the template no one else is going to be able compile custom versions of the template (it doesn't have to be this way, but it is as templates never really got past the glorified...

Part and Inventory Search

Back
Top