0

compiler : g++ of gcc4.5.2(minGW)
os : windows xp sp3(32bits)

template<typename T, template<typename> class CONT = AccumulationTraits >
class Accum
{
  public :
    static typename CONT<T>::AccT accum(T const *beg, T const *end)
    {
      typename CONT<T>::AccT total = CONT<T>::zero();
      while(beg != end)
      {
        total += *beg;
        ++beg;
      }
      return total;
    }
};

template<typename T, template<typename> class CONT = AccumulationTraits >
inline typename CONT<T>::AccT accum(T const *beg, T const *end)
{
  return Accum<T, CONT>::accum(beg, end);
}

The code like this work fine on gcc4.5.2
Is this a legal feature of C++0x or a special feature support by gcc?
I can't find any information from the C++0x faq maintain by Bjarne Stroustrup(maybe I missed it)
Thanks a lot

2
Contributors
2
Replies
4
Views
6 Years
Discussion Span
Last Post by stereomatching
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.