Question: I am using ASP.NET MVC routes to direct traffic based on certain words, for instance `mydomain.com/support` which directs to the support page (under the Home controller), or `mydomain.com/controller/action/id` as per default.

However I would also like traffic to have the ability to use any single word after the gTLD - that I haven't already specified - to hit my home page.

For instance: `mydomain.com/anything` would still hit my home page and not produce a 404 response. Where *anything* is any word other than what I have already specified (so in this example "support").

Is this even possible?

Answer: 
Or use helper template if you are not sure the optimizer will get rid of the `if`s:

```
void functionToCall(int number) { /* ... */ }

template<bool doCall>
struct FuncCaller {
    template<typename Callable>
    FuncCaller(Callable func, int number) { func(number); }
};

template<>
struct FuncCaller<false> {
    template<typename Callable>
    FuncCaller(Callable, int) {}
};

update()
{
    FuncCaller<(F1 > 0)>(functionToCall, F1);
    FuncCaller<(F2 > 0)>(functionToCall, F2);
    FuncCaller<(F3 > 0)>(functionToCall, F3);
}

```
you could try doing that using Boost Metaprogramming libraries, but requires you to change the template definition of the class to make room for Boost MPL parameters.

An example of what you want to do with Boost::MPL would be:

```
#include <boost/mpl/vector.hpp>
#include <boost/mpl/empty.hpp>
#include <boost/mpl/back.hpp>
#include <boost/mpl/pop_back.hpp>
#include <boost/mpl/if.hpp>
#include <iostream>

using namespace boost::mpl;
template<class T>
class Test {
public:
  void funcToCall() {
    std::cout << "I'm called\n";
  }
  void update();
};

template<class Y, class T>
struct Update {
  static void update(T* t) {
    typedef typename pop_back<Y>::type vec_less;
    if (back<Y>::type::value > 0)
      t->funcToCall();
    Update<typename if_<empty<vec_less>, void, vec_less >::type, T>::update(t);
  }
};
template<class T>
struct Update<void ,T> {
  static void update(T* t) {}
};

template<class T>
void Test<T>::update() {

Update<T, Test<T> >::update(this);

}

int main() {
  Test<vector<int_<0>,int_<4>, int_<9> > > t;
  t.update();
  return 0;
}

```

The class "Test" would be your original "TemplatedClass". Now instead of getting a list of int template parameters you just get one parameter that is a boost::mpl::vector. This contains all the ints you want to pass and then you call the update function that will call recursively the update methods from struct "Update" that will have the duty of calling the "funcToCall()" method if the int is more than 0.

The output of the program I pasted above is:

> 
> MacBook-Pro-di-Marcello:~ Kariddi$ ./test
> 
> 
> I'm called
> 
> 
> I'm called
> 
> 
> 

Of course you need the Boost libs for this example to work.

You can find information about MPL here:

<http://www.boost.org/libs/mpl/doc/index.html>

Cheers,
Marcello