E
Exits Funnel
Hello,
I've been tasked with porting some code which was written on Windows to
Linux (g++). The following is an excerpt of the code (which I've pared
down to the absolute minimum required to generate the error):
//Begin foo.cpp
template <typename BT>
struct chi_t { };
template<typename BT>
class B
{
public:
static chi_t<BT> sbhs;
};
struct PTB { };
class PTB_t : public B<PTB> { };
chi_t<PTB> PTB_t::sbhs("PTB" "PTB"); // This is line 15
//End foo.cpp
g++ has this to say:
foo.cpp:15: ISO C++ does not permit `B<PTB>::sbhs' to be defined as
`PTB_t::sbhs'
I have two questions:
1) What is line 15 trying to do? Even if g++ is correct to complain, it
compiles (presumably) on windows so it must mean something but I can't
'parse' it in my head. Is the 'sbhs("PTB" "PTB")' bit a ctor call?
2) Is there some obvious fix I can make to placate g++?
Thanks in advance.
-exits
I've been tasked with porting some code which was written on Windows to
Linux (g++). The following is an excerpt of the code (which I've pared
down to the absolute minimum required to generate the error):
//Begin foo.cpp
template <typename BT>
struct chi_t { };
template<typename BT>
class B
{
public:
static chi_t<BT> sbhs;
};
struct PTB { };
class PTB_t : public B<PTB> { };
chi_t<PTB> PTB_t::sbhs("PTB" "PTB"); // This is line 15
//End foo.cpp
g++ has this to say:
foo.cpp:15: ISO C++ does not permit `B<PTB>::sbhs' to be defined as
`PTB_t::sbhs'
I have two questions:
1) What is line 15 trying to do? Even if g++ is correct to complain, it
compiles (presumably) on windows so it must mean something but I can't
'parse' it in my head. Is the 'sbhs("PTB" "PTB")' bit a ctor call?
2) Is there some obvious fix I can make to placate g++?
Thanks in advance.
-exits