2.5.1
Freundlich's C++ toolkit
Functions
fcppt.assign

Description

A supplement to C++11 initialization.

C++11 provides initializer lists to initialize containers. One drawback is that they cannot be used to initialize containers of movable objects.

For example, fcppt::signal::auto_connection_container is a vector of connections (which are movable only). To initialize such a container, fcppt::assign::make_container can be used.

typedef
std::vector<
int
>
>
int_unique_ptr_vector;
int_unique_ptr_vector const int_ptrs(
int_unique_ptr_vector
>(
int
>(
1
),
int
>(
2
)
)
);
// Prints 1 2
for(
auto const &elem
:
int_ptrs
)
std::cout << *elem << '\n';

Functions

template<typename Container , typename... Args>
Container fcppt::assign::make_container (Args &&... _args)
 Creates a container from variadic arguments by moving. More...
 

Function Documentation

◆ make_container()

template<typename Container , typename... Args>
Container fcppt::assign::make_container ( Args &&...  _args)
inline

Creates a container from variadic arguments by moving.