T
Thomas J. Clancy
I was just wondering. After all these years of working on
Visual C++, why hasn't Microsoft yet seen fit to fully
implement the template portion of the C++ standard when so
many other vendors, both free and commercial, have, or at
least have come very close to doing so. I write code in
pure C++ and I so often have to ifdef the heck out of my
code just to get it to work in Visual C++.
Here is a simple example of what I mean:
#ifdef _WIN32
template<typename T,
template<typename Element,
typename Alloc = std::allocator<ELEM> >
class Container = std::deque >
class Stack
{
Container<T,std::allocator<T> > m_elems;
#else
template<typename T,
template<typename Element,
typename = std::allocator<ELEM> >
class Container = std::deque >
class Stack
{
Container<T> m_elems;
#endif
Note how under the _WIN32 code I need to name Alloc rather
than just setting the second typename's default, and of
course in the body, VC++ ignores the default an I have to
explicitly define Container with the element type and the
allocator type. This is just messy.
So, does anyone know why Microsoft just hasn't hired a
template expert to implement templates correctly? I
suppose that they are just trying to kill C++ as well as
everything not invented by them. Ah well. It'll be a C#
world after all. Ugggg.
Thomas J. Clancy
Visual C++, why hasn't Microsoft yet seen fit to fully
implement the template portion of the C++ standard when so
many other vendors, both free and commercial, have, or at
least have come very close to doing so. I write code in
pure C++ and I so often have to ifdef the heck out of my
code just to get it to work in Visual C++.
Here is a simple example of what I mean:
#ifdef _WIN32
template<typename T,
template<typename Element,
typename Alloc = std::allocator<ELEM> >
class Container = std::deque >
class Stack
{
Container<T,std::allocator<T> > m_elems;
#else
template<typename T,
template<typename Element,
typename = std::allocator<ELEM> >
class Container = std::deque >
class Stack
{
Container<T> m_elems;
#endif
Note how under the _WIN32 code I need to name Alloc rather
than just setting the second typename's default, and of
course in the body, VC++ ignores the default an I have to
explicitly define Container with the element type and the
allocator type. This is just messy.
So, does anyone know why Microsoft just hasn't hired a
template expert to implement templates correctly? I
suppose that they are just trying to kill C++ as well as
everything not invented by them. Ah well. It'll be a C#
world after all. Ugggg.
Thomas J. Clancy