Seems like that the best way is to use the INLINE pragma. sort from vector-algorithms uses it too.
INLINE
sort