BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslmf_arraytopointer

Macros

#define bslmf_ArrayToConstPointer   bslmf::ArrayToConstPointer
 This alias is defined for backward compatibility.
 
#define bslmf_ArrayToPointer   bslmf::ArrayToPointer
 This alias is defined for backward compatibility.
 

Detailed Description

Outline

Purpose

Provide a meta-function to convert array types to pointer types.

Classes

See also
bslmf_isarray, bslmf_forwardingtype

Description

This component provides a meta function for converting array types to pointer types. The utility is generally used for in templates that require forwarding or storage of arguments that are passed a arrays(e.g., "string literals"). For non array types, the type is left unmodified. Note that bslmf::ArrayToPointer and bslmf::ArrayToConstPointer retain the CV qualifiers of the original type. In other words, if the original array type was const or volatile, or const volatile, the converted pointer type will also be const, volatile, or const volatile respectively.

When an explicit const pointer pointer type is needed(such as when accepting as argument, then bslmf::ArrayToConstPointer should be used.

Usage

For example:

assert(1 == bsl::is_same<bslmf::ArrayToPointer<int[5]>::Type
, int *>::value);
, int *>::value);
assert(0 == bsl::is_same<bslmf::ArrayToPointer<int (*)[5]>::Type]
, int **>::value);
Definition bslmf_issame.h:146
Definition bslmf_arraytopointer.h:94
ArrayToPointer_Imp< t_TYPE, t_TYPE >::Type Type
Definition bslmf_arraytopointer.h:95

Macro Definition Documentation

◆ bslmf_ArrayToConstPointer

#define bslmf_ArrayToConstPointer   bslmf::ArrayToConstPointer

◆ bslmf_ArrayToPointer

#define bslmf_ArrayToPointer   bslmf::ArrayToPointer