mardi 29 septembre 2015

C++ variadic template iteratre vector and compare elements

I have a variadic template

template <size_t ...T>
struct Foo 
{
   vector<size_t> t;

   bool IsEqual()
   {
     //??
   }

}

I create

Foo<1,2,3,4> foo;
foo.data = {1,2,3,4};
foo.IsEqual();

How can I implement IsEqual to iterate and compare every element of array and return false / true depending if elements are in the same order as in template parametrs?

Aucun commentaire:

Enregistrer un commentaire