Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > What is .tcc?

Reply
Thread Tools

What is .tcc?

 
 
jsnX
Guest
Posts: n/a
 
      04-04-2005
Where is there some documentation about this suffix?
--
_jason

 
Reply With Quote
 
 
 
 
Malte Starostik
Guest
Posts: n/a
 
      04-04-2005
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments