```
int min_unused(const vector& v)
{
for (int i = 1;; i++)
{
if (rng::find(v, i) == v.end())
return i;
}
}
```

Advantages: const vector, duplicates allowed

]]>```
-- counting sort (courtesy of https://stackoverflow.com/questions/39809527/explain-and-clarify-haskell-counting-sort)
--
countingSort :: Ix a => [a] -> a -> a -> [a]
countingSort l lo hi = concat [replicate times n | (n, times) < - counts]
where counts = assocs (accumArray (+) 0 (lo, hi) [(i, 1) | i xs!!i + 1 (if v mx then v else mx)) (head ys, head ys) ys
l = length ys
```

]]>You are right that it is consistent to apply inline also to function templates, but it’s not used in any of the STL implementations or other template heavy code that I know of. So it’s perhaps not idiomatic and surprising/distracting for readers of your code.

]]>I’m still going to prefer and recommend explicit inline usage to be consistent with regular function usage, and function template specializations (17.7.3/12 [temp.expl.spec]).

]]>Brackets fixed!

]]>https://godbolt.org/g/yb8Cjj ]]>

The other day I had a problem with forwarding function parameters, whose (decayed) types are part of class template arguments.

`template` class MulticastDelegate;
template
class MulticastDelegate
{
//can't perfect forward here!
//void operator()(ArgsT&& ... args); //&& means rvalue
void operator()(ArgsT ... args);
//This would be one way of solving the problem
//template
//void operator()(OtherArgsT&& ... args); //&& means forwarding
};

I wonder if there is a nice solution other than making the function templated?

]]>