I pass a mpl::vector with duplicates to mpl::unique and the result still
has duplicates.
What am I doing wrong?
http://coliru.stacked-crooked.com/a/fe85b5739eb4c15f
#include
#include
#include
#include
#include
#include
template< typename... Args >
void test( const Args&... args )
{
using namespace boost::mpl;
using namespace boost::mpl::placeholders;
typedef vector args_types;
typedef typename unique >::type unique_types;
print< unique_types > x;
}
int main()
{
int a = 0;
char b = 0;
test( a, b, a );
}
+ g++-4.8 -std=c++11 -O2 -Wall -pedantic -pthread main.cpp
main.cpp: In instantiation of ‘void test(const Args& ...) [with Args =
{int, char, int}]’:
main.cpp:22:19: required from here
main.cpp:15:27: warning: unused variable ‘x’ [-Wunused-variable]
print< unique_types > x;
^
+ ./a.out