, , . - :
template <class T>
struct tree_node {
struct tree_node *left, *right;
T data;
}
, , node. ( , ), , .
, , ( ), , ( , ) . , " ", , , :
template <class T>
class some_string {
static const limit = 20;
size_t allocated;
size_t in_use;
union {
T short_data[limit];
T *long_data;
};
};
- . , , ( , ) swap , nothrow:
template <class T>
class parent {
T *data;
void friend swap(parent &a, parent &b) throw() {
T *temp = a.data;
a.data = b.data;
b.data = temp;
}
};
( ) :
... nothrow (.. : "swap " ). parent , , (, swap , T . ")
++ 11 (?) ( nothrow). , () - , .
, , , , , : , , , . () . , , , , . , , . , C, ++ ( ) - , , , , . (, Windows, Linux) ( , ).
, , , ( ), , ( , ) , . : , , / , "", .
, , , . :
: , , . - , , (?) , , . , , , , operator new .