5 Quantities and units library [quantities]

5.5 Representation [qty.rep]

5.5.3 Customization point objects [qty.rep.cpos]

5.5.3.1 General [qty.rep.cpos.general]

Within subclause [qty.rep.cpos], reified object is as defined in N4971, [range.access.general].

5.5.3.2 mp_units​::​real [qty.real.cpo]

The name mp_units​::​real denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, let t be an lvalue that denotes the reified object for E.
Then:
  • If T does not model WeaklyRegular, mp_units​::​real(E) is ill-formed.
  • If auto(t.real()) is a valid expression whose type models Scalar, mp_units​::​real(E) is expression-equivalent to auto(t.real()).
  • Otherwise, if T is a class or enumeration type and auto(real(t)) is a valid expression whose type models Scalar where the meaning of real is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), then mp_units​::​real(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​real(E) is ill-formed.

5.5.3.3 mp_units​::​imag [qty.imag.cpo]

The name mp_units​::​imag denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, let t be an lvalue that denotes the reified object for E.
Then:
  • If T does not model WeaklyRegular, mp_units​::​imag(E) is ill-formed.
  • If auto(t.imag()) is a valid expression whose type models Scalar, mp_units​::​imag(E) is expression-equivalent to auto(t.imag()).
  • Otherwise, if T is a class or enumeration type and auto(imag(t)) is a valid expression whose type models Scalar where the meaning of imag is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), then mp_units​::​imag(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​imag(E) is ill-formed.

5.5.3.4 mp_units​::​modulus [qty.modulus.cpo]

The name mp_units​::​modulus denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, let t be an lvalue that denotes the reified object for E.
Then:
  • If T does not model WeaklyRegular, mp_units​::​modulus(E) is ill-formed.
  • If auto(t.modulus()) is a valid expression whose type models Scalar, mp_units​::​modulus(E) is expression-equivalent to auto(t.modulus()).
  • Otherwise, if T is a class or enumeration type and auto(modulus(t)) is a valid expression whose type models Scalar where the meaning of modulus is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), then mp_units​::​modulus(E) is expression-equivalent to that expression.
  • If auto(t.abs()) is a valid expression whose type models Scalar, mp_units​::​modulus(E) is expression-equivalent to auto(t.abs()).
  • Otherwise, if T is a class or enumeration type and auto(abs(t)) is a valid expression whose type models Scalar where the meaning of abs is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), then mp_units​::​modulus(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​modulus(E) is ill-formed.

5.5.3.5 mp_units​::​magnitude [qty.mag.cpo]

The name mp_units​::​magnitude denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, let t be an lvalue that denotes the reified object for E.
Then:
  • If T does not model WeaklyRegular, mp_units​::​magnitude(E) is ill-formed.
  • If auto(t.magnitude()) is a valid expression whose type models Scalar, mp_units​::​magnitude(E) is expression-equivalent to auto(t.magnitude()).
  • Otherwise, if T is a class or enumeration type and auto(magnitude(t)) is a valid expression whose type models Scalar where the meaning of magnitude is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), then mp_units​::​magnitude(E) is expression-equivalent to that expression.
  • Otherwise, if auto(t.abs()) is a valid expression whose type models Scalar, mp_units​::​magnitude(​E) is expression-equivalent to auto(t.abs()).
  • Otherwise, if T is a class or enumeration type and auto(abs(t)) is a valid expression whose type models Scalar where the meaning of magnitude is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), then mp_units​::​magnitude(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​magnitude(E) is ill-formed.