boost::unordered_set intersection using templates I wrote this function to do unordered_set intersection using templates. I have seen this answer but I thought that it was overkill. I would like the method to take in 2 sets and return a set.

class SetUtilites{
public:
    template&lt;typename Type&gt;
    static boost::unordered_set&lt;Type&gt; intersection(const boost::unordered_set&lt;Type&gt; &amp;set1, const boost::unordered_set&lt;Type&gt; &amp;set2){
        if(set1.size() &lt; set2.size()){

            boost::unordered_set&lt;Type&gt; iSet;

            boost::unordered_set&lt;Type&gt;::iterator it;
            for(it = set1.begin(); it != set1.end();++it){
                if(set2.find(*it) != set2.end()){
                    iSet.insert(*it);
                }
            }
            return iSet;
        }else{
            return intersection(set2,set1);
        }
    }
};
SetUtilites is misspelled; it should be SetUtilities.
For better readability, consider doing something about this long line:


static boost::unordered_set&lt;Type&gt; intersection(const boost::unordered_set&lt;Type&gt; &amp;set1, const boost::unordered_set&lt;Type&gt; &amp;set2)



You could shorten the types as such via typedef, but it may not help very much, or it may even make things uglier.  You could also wrap the line in some way.  Choose whichever works best.
Do you even need a class for this?  It just contains one function and no data members, so it's not really doing anything relevant as one.  Instead, just make this a free function (non-member function) and put it into a namespace with a similar name as the class.
The name iSet sort of sounds like Hungarian notation, although it appears to be a shortened form of intersectionSet.  If you still don't want to call it something that lengthy, you could rename it to something like finalSet, indicating that it will be returned from the function.