|Compiling C++ Templates as opposed to Preprocessing them. firstname.lastname@example.org (Seima Rao) (2010-07-27)|
|Re: Compiling C++ Templates as opposed to Preprocessing them. email@example.com (mac) (2010-07-31)|
|Re: Compiling C++ Templates as opposed to Preprocessing them. firstname.lastname@example.org (Kenneth 'Bessarion' Boyd) (2010-08-16)|
|From:||Seima Rao <email@example.com>|
|Date:||Tue, 27 Jul 2010 13:36:42 +0530|
|Keywords:||C++, performance, question|
|Posted-Date:||27 Jul 2010 10:36:05 EDT|
Can readers of this forum advise on whether it would be
fruitful to consider compiling C++ templates to
IR instead of preprocessing them?
Consider the following snippet:
foo(const T &t)
T::i; // #1
Since the compiler cannot tell if `i' is a static member of `T',
an extra operator needs to be introduced in the IR so that
the `::' operator can be mapped to it. This operator would
have no use in a non-generic scope, therefore, that operator
is there merely to represent templates in the IR.
I am sure professional compiler writers would have
(many) non-trivial issues to tell.
What I want to know is the following:
1) Has C++ been defined to accomodate compilation of templates?
2) Is name resolution unambiguously doable in template scopes
so that IRs that represent templates dont have to worry about
it at all?
Return to the
Search the comp.compilers archives again.