Go Back   Velocity Reviews > Newsgroups > C++
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

C++ - What is .tcc?

 
Thread Tools Search this Thread
Old 04-05-2005, 12:41 AM   #1
Default What is .tcc?


Where is there some documentation about this suffix?
--
_jason



jsnX
  Reply With Quote
Old 04-05-2005, 12:51 AM   #2
Malte Starostik
 
Posts: n/a
Default Re: What is .tcc?
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
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46