STL Extension/Modification Best Practice
<p>I have been writing in c++ for a few months, and i am comfortable enough with it now to begin implementing my own library, consisting of things that i have found myself reusing again and again. One thing that nagged me was the fact that you always had to provide a beginning and end iterator for functions like <code>std::accumulate</code>,<code>std::fill</code> etc...</p>

<p>The option to provide a qualified container was completely absent and it was simply an annoyance to write begin and end over and over. So, I decided to add this functionality to my library, but i came across problem, i couldn't figure out the best approach of doing so. Here were my general solutions:</p>

<p><strong>1. Macros</strong>  <br><br>
        - A macro that encapsulates an entire function call<br>
              ex. <code>QUICK_STL(FCall)</code>  <br><br>
        - A macro that takes the container, function name, and optional args<br>
              ex. <code>QUICK_STL(C,F,Args...)</code>  </p>

<p><strong>2. Wrapper Function/Functor</strong> <br><br>
        - A class that takes the container, function name, and optional args<br>
              ex. <code>quick_stl(F, C, Args...)</code>  <br></p>

<p><strong>3. Overload Functions</strong><br><br>
        - Overload every function in namespace <code>std</code> OR my library namespace<br>
ex           </p>

<pre><code>namespace std { // or my library root namespace 'cherry' 
    template &lt;typename C, typename T&gt;
    decltype(auto) count(const C&amp; container, const T&amp; value);
}
</code></pre>

<p><br><br></p>

<p>I usually steer clear of macros, but in this case it could certainty save <em>alot</em>
of lines of code from being written. With regards to function overloading, every single function that i want to use i must overload, which wouldn't really scale. The upside to that approach though is that you retain the names of the functions. With perfect forwarding and <code>decltype(auto)</code> overloading becomes alot easier, but still will take time to implement, and would have to be modified if ever another function was added. As to whether or not i should overload the <code>std</code> namespace i am rather skeptical on whether or not it would be appropriate in this case. </p>

<p><em>What would be the most appropriate way of going about overloading functions in the STD namespace (note these functions will only serve as proxy's to the original functions)?</em></p>