# C++ named requirements: TransformationTrait (since C++11)

> C++ Atlas: `cppatlas.com/w/cpp/named_req/TransformationTrait` | Source: https://en.cppreference.com/w/cpp/named_req/TransformationTrait | Domain: Named Requirements | Standards: C++11, C++17

A TransformationTrait is a class template that provides a transformation of its template type parameter.

## Official Specification Summary (cppreference)

A *TransformationTrait* is a class template that provides a transformation of its template type parameter.

### Requirements

- Takes one template type parameter (additional template parameters are optional and allowed).
- The transformed type is a publicly accessible nested type named `type`.

### Standard library

All type transformation traits satisfy *TransformationTrait*.

The following standard library class templates also satisfy *TransformationTrait*.

- `std::tuple_element<std::tuple>` (C++11): obtains the type of the specified element (class template specialization)
- `std::tuple_element<std::pair>` (C++11): obtains the type of the elements of `pair` (class template specialization)
- `std::tuple_element<std::array>` (C++11): obtains the type of the elements of `array` (class template specialization)
- `variant_alternative` (C++17), `variant_alternative_t`: obtains the type of the alternative specified by its index, at compile time (class template) (alias template)

---
Attribution: content from https://en.cppreference.com/w/cpp/named_req/TransformationTrait (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.