std::is_final - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::is_final

From cppreference.com
< cpp‎ | types

Defined in header `<type_traits>` |  |
template< class T > struct is_final; |  | (since C++14)

If `T` is a final class (that is, a class declared with the final specifier), provides the member constant `value` equal true. For any other type, `value` is false.

## Inherited from std::integral_constant

### Member constants

value [static] | true if `T` is a final class type , false otherwise (public static member constant)

### Member functions

operator bool | converts the object to bool, returns `value` (public member function)

### Member types

Type | Definition
`value_type` | `bool`
`type` | std::integral_constant<bool, value>

### [edit] Notes

Final classes cannot be used as base classes.

A union can be marked `final` (and `std::is_final` will detect that), even though unions cannot be used as bases in any case.

### [edit] Example

| This section is incomplete Reason: no example

### [edit] See also

is_class (C++11) | checks if a type is a class type (but not union type) (class template) [edit]
is_polymorphic (C++11) | checks if a type is polymorphic class type (class template) [edit]

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/types/is_final&oldid=67912"
Category:

- Todo no example