D
Dave
Hello all,
Here is the definition I'm using of a static const class member:
template<typename T, typename U>
const U directed_graph_t<T, U>::INFINITY =
(
std::numeric_limits<U>::has_infinity ?
std::numeric_limits<U>::infinity() :
std::numeric_limits<U>::max()
);
This works fine.
However, Comeau does not accept the following very similar definition:
template<typename T, typename U>
const U directed_graph_t<T, U>::INFINITY =
std::numeric_limits<U>::has_infinity ?
std::numeric_limits<U>::infinity() :
std::numeric_limits<U>::max();
The following error is reported:
"ComeauTest.c", line 172: error: expected a ";" (perhaps on the previous
statement)
std::numeric_limits<U>::infinity() :
^
1 error detected in the compilation of "ComeauTest.c".
NOTE: The carat points to the colon at the end of the line. If you're
viewing this with a proportional font, you won't be able to tell that...
Any idea what's up with this?
Thanks,
Dave
Here is the definition I'm using of a static const class member:
template<typename T, typename U>
const U directed_graph_t<T, U>::INFINITY =
(
std::numeric_limits<U>::has_infinity ?
std::numeric_limits<U>::infinity() :
std::numeric_limits<U>::max()
);
This works fine.
However, Comeau does not accept the following very similar definition:
template<typename T, typename U>
const U directed_graph_t<T, U>::INFINITY =
std::numeric_limits<U>::has_infinity ?
std::numeric_limits<U>::infinity() :
std::numeric_limits<U>::max();
The following error is reported:
"ComeauTest.c", line 172: error: expected a ";" (perhaps on the previous
statement)
std::numeric_limits<U>::infinity() :
^
1 error detected in the compilation of "ComeauTest.c".
NOTE: The carat points to the colon at the end of the line. If you're
viewing this with a proportional font, you won't be able to tell that...
Any idea what's up with this?
Thanks,
Dave