What is .tcc?

Discussion in 'C++' started by jsnX, Apr 5, 2005.

  1. jsnX

    jsnX Guest

    Where is there some documentation about this suffix?
    --
    _jason
    jsnX, Apr 5, 2005
    #1
    1. Advertising

  2. jsnX schrieb:
    > Where is there some documentation about this suffix?

    It's not standardised. Some use .tcc (t = template, cc = C++ source),
    some use .icc (i = included, cc = C++ source), some use .h (but that
    makes it indistinguishable from "real" headers), some just don't use an
    extra file at all. It's usually a file that contains implementations of
    templates declared in a header that then #includes the .tcc (or
    whatever) file. But as there is no standard nor a general consense
    about this, it could be anything else as well.
    It's just an artifact of the need to have template definitions visible
    in all translation units that use them with most compilers:

    ====example.hpp====
    #ifndef EXAMPLE_HPP
    #define EXAMPLE_HPP

    template< typename T > void f();

    #include "example.tcc"

    #endif

    ====example.tcc====
    #ifndef EXAMPLE_HPP
    # error Don't include this file directly, include example.hpp instead
    #endif

    template< typename T > void f()
    {
    // stuff
    }

    Cheers,
    Malte
    Malte Starostik, Apr 5, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    308
    Jack Klein
    Apr 19, 2006
  2. Replies:
    1
    Views:
    1,647
    Ian Collins
    Aug 4, 2008
  3. lovecreatesbeauty

    The end of C-like script languages - C script with TCC

    lovecreatesbeauty, May 20, 2011, in forum: C Programming
    Replies:
    19
    Views:
    1,317
    Malcolm McLean
    Jun 19, 2011
  4. lovecreatesbeauty

    Web programming in C lang with TCC

    lovecreatesbeauty, Jun 16, 2011, in forum: C Programming
    Replies:
    79
    Views:
    2,009
  5. Malcolm McLean

    Tcc won't link libraries.

    Malcolm McLean, Jun 18, 2011, in forum: C Programming
    Replies:
    3
    Views:
    656
    Shao Miller
    Jun 19, 2011
Loading...

Share This Page