SFINAE and enable_if<>
======================
See:
* `Template SFINAE & type-traits (very good) `_
* `Filipek: Notes on C++ SFINAE `_
* `Filipek: SFINAE Followup `_
* `SFINAE and enable_if (very good) `_
* `Modern C++, Item 27 by Scott Meyers`
* `Microsoft enable_if Article has Several Examples `_
Type alias, alias template
--------------------------
The keyword ``using`` is a another way of creating a **typedef**, an alias of a type.
.. code-block:: cpp
template class Vector {
public:
using value_type = T; // Same as: typedef T value_type;
//...
};
Vector v;
Vector::value_type x = 10; // x is of type int.
``using value_type = T;`` is equivalent to ``typedef T value_type;``. There is also a form of **using** for use with templates. It can help to create, for example, more readable templates.
.. code-block:: cpp
template struct Alloc {
//...
};
template using Vec = vector>; // type-id is vector>
Vec v; // Vec is the same as vector>
``Vec`` is an alias template, and ``Vec`` results in substituting **int** for T in ``template vector>``. Thus, ``Vec`` is just an alias for ``vector>``.
.. todo:: Finish later.