[#bsl-add_pointer-080] = xref:bsl.adoc[bsl]::add_pointer :relfileprefix: ../ :mrdocs: This `struct` template implements the `add_pointer` meta‐function defined in the C++11 standard [meta.trans.ptr], providing an alias, `type`, that returns the result. If the (template parameter) `t_TYPE` is not a reference type, then `type` is an alias to a pointer type that points to `t_TYPE`; otherwise, `type` is an alias to a pointer type that points to the type referred to by the reference `t_TYPE`, unless it is not legal to form such a pointer type, in which case `type` is an alias for `t_TYPE`. == Synopsis Declared in `<bslmf_addpointer.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_TYPE> struct add_pointer; ---- == Type Aliases [cols="1,4"] |=== | Name| Description | xref:bsl/add_pointer-080/type.adoc[`type`] | This `typedef` is an alias to a pointer type that points to the (template parameter) `t_TYPE` if it is not a reference type; otherwise, this `typedef` is an alias to a pointer type that points to the type referred to by the reference `t_TYPE`. |=== == Specializations [cols="1,4"] |=== | Name| Description | xref:bsl/add_pointer-085.adoc[`add_pointer<t_TYPE&>`] | If we can form a reference to `t_TYPE`, then we can also form a pointer to it. In particular, we know that it is not `void` (which should still work) or an "abominable" function type with a trailing cv‐qualifier. Note that this partial specialization is necessary to avoid falling into degenerate (non‐compiling) cases in the implementation meta‐program. | xref:bsl/add_pointer-05.adoc[`add_pointer<t_TYPE&&>`] | If we can form a reference to `t_TYPE`, then we can also form a pointer to it. In particular, we know that it is not `void` (which should still work) or an "abominable" function type with a trailing cv‐qualifier. Note that this partial specialization is necessary to avoid falling into degenerate (non‐compiling) cases in the implementation meta‐program. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#