$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Sid Sacek (ssacek_at_[hidden])
Date: 2007-12-04 14:22:06
>> That's because you cannot instantiate a class template with a string in C++.
Actually you can, but are limited to strings with external linkage. Another problem with this aspect of templates is that not all
compilers support this syntax yet.
-Sid Sacek
#include <stdio.h>
template< const char * name >
class foo
{
const char * val;
public:
foo() : val( name ) { }
const char * value( void ) { return val; }
};
extern const char exname[] = "hello world";
int main( int, char ** )
{
foo< exname > myfoo;
printf( " %s \n", myfoo.value() );
}