OTOH, if taking two arguments isn't a problem, you can give yourself a lot more flexibility at basically no cost, by accepting an iterator range instead:
template <typename HWNDIterator>void SomeMethod(HWNDIterator begin, HWNDIterator end) { // Of course you could also use std::for_each for this trivial example :) for (HWNDIterator i = begin; i != end; ++i) { // By the way, you should not dereference the pointer before subscripting, // in your original code. Subscripting already implies a dereference; // foo is equivalent to *(foo + i). DoSomethingWithWindow(*i); }}// Passing an array:SomeMethod(array, array + sizeof(array) / sizeof(array[0]));// You might want to use the inline function taking an array reference to// simplify that.// Passing a std::vector, *or any other standard library container*// (except std::(multi)map, because its iterators yield key-value pairs):SomeMethod(container.begin(), container.end());// Passing a single element:SomeMethod(&thing, &thing + 1);