I have a question of "good design practices" in C++. I am writing a numerical library in C++11 and I use at lot of metaprogramming and template-based technique. But I have a very basic question :

Consider a function that can have a two very close behaviours excepted an option that can be activated by a boolean flag. I consider only a flag that can be set/unset by the developer and not a flag that can be set/unset at runtime. There are 3 possibilities of design :

---

1) Write two functions with the explicit option in their name :

```
myFunctionFlag1(...);
myFunctionFlag2(...); 

```

2) Use a template parameter :

```
template<bool Flag> myFunction(...);

```

3) Use a variable parameter :

```
myFunction(..., const bool flag);

```

---

In terms of good design practices which solution is acceptable/unacceptable ? If there is a best solution, which one is it and why ? If there is a worst solution, which one is it and why ?

EDIT : for the considered functions the runtime overhead could be considered as negligible, so this is not the most critical point.

EDIT 2 : I know that all the three work. But as my library will have users, it needs to have a reliable/good design.

Is the option 2 common (because it seems to me to be a good compromise) ?