Commit 6323646e by zhanyong.wan

fixes XL C++ compiler errors (by Pasi Valminen)

parent 7d560ed6
......@@ -788,13 +788,14 @@ struct RemoveConst { typedef T type; }; // NOLINT
template <typename T>
struct RemoveConst<const T> { typedef T type; }; // NOLINT
// MSVC 8.0 and Sun C++ have a bug which causes the above definition
// to fail to remove the const in 'const int[3]'. The following
// specialization works around the bug. However, it causes trouble
// with GCC and thus needs to be conditionally compiled.
#if defined(_MSC_VER) || defined(__SUNPRO_CC)
// MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
// definition to fail to remove the const in 'const int[3]' and 'const
// char[3][4]'. The following specialization works around the bug.
// However, it causes trouble with GCC and thus needs to be
// conditionally compiled.
#if defined(_MSC_VER) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
template <typename T, size_t N>
struct RemoveConst<T[N]> {
struct RemoveConst<const T[N]> {
typedef typename RemoveConst<T>::type type[N];
};
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment