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: 
Instead of writing a series of `if` statements you can also put all the arguments into an array and iterate through it. This way compiler won't be able to optimize your code (you didn't specify if this is required), but it will look much cleaner I think. E.g.

```
template<int F1, int F2 ,int F3>
struct TemplatedClass
{ 
    TemplatedClass(); 
    update() 
    {
        const int array[] = {F1, F2, F3};
        // replace this with std::for_each(...) with functors you need
        for (int i = 0; i < sizeof(array)/sizeof(array[0]); ++i)
        {
            myfunc(array[i]);
        }
    } 
} 

```
With the number of template arguments fixed, a simple code like this will do:

```
update()
{
    if (F1 > 0) callAMethod();
    if (F2 > 0) callAMethod();
    if (F3 > 0) callAMethod();
}

```

The expressions in the `if` statement are compile-time constants, so the optimizer will optimize it into the code that is equivalent to either calling the method "unguarded" (without a branch) or not calling the method at all. In other words, the decision to call the method or not will be made at compile time by the optimizer for no run-time cost.