libpqxx
4.0.1
|
Container of items with easy contents initialization and string rendering. More...
#include <util.hxx>
Public Member Functions | |
items () | |
Create empty items list. | |
items (const T &t) | |
Create items list with one element. | |
items (const T &t1, const T &t2) | |
items (const T &t1, const T &t2, const T &t3) | |
items (const T &t1, const T &t2, const T &t3, const T &t4) | |
items (const T &t1, const T &t2, const T &t3, const T &t4, const T &t5) | |
items (const CONT &c) | |
Copy container. | |
items & | operator() (const T &t) |
Add element to items list. |
Container of items with easy contents initialization and string rendering.
Designed as a wrapper around an arbitrary container type, this class lets you easily create a container object and provide its contents in the same line. Regular addition methods such as push_back() will also still work, but you can now write things like
Up to five elements may be specified directly as constructor arguments, e.g.
One thing that cannot be done with this simple class is create const objects with nontrivial contents. This is because the function invocation operator (which is being used to add items) modifies the container rather than creating a new one. This was done to keep performance within reasonable bounds.
pqxx::items< T, CONT >::items | ( | ) |
Create empty items list.
|
explicit |
Create items list with one element.
pqxx::items< T, CONT >::items | ( | const T & | t1, |
const T & | t2 | ||
) |
pqxx::items< T, CONT >::items | ( | const T & | t1, |
const T & | t2, | ||
const T & | t3 | ||
) |
pqxx::items< T, CONT >::items | ( | const T & | t1, |
const T & | t2, | ||
const T & | t3, | ||
const T & | t4 | ||
) |
pqxx::items< T, CONT >::items | ( | const T & | t1, |
const T & | t2, | ||
const T & | t3, | ||
const T & | t4, | ||
const T & | t5 | ||
) |
pqxx::items< T, CONT >::items | ( | const CONT & | c | ) |
Copy container.
items& pqxx::items< T, CONT >::operator() | ( | const T & | t | ) |
Add element to items list.