Parma Polyhedra Library requirements
C++ checked special-value factories

C++ checked special-value factories

UID:
VERSION:
CLASSIFICATION:
PREFIX:
Type
Level
MID
UID
REFS
Title
Statement
Rationale
Comment
BIBLIOGRAPHY
STATUS
COMPONENT
APPLICABILITY
VERIFICATION_METHODS
VERIFICATION_CRITERIA
SOURCE
LANGUAGE
VISIBILITY
INTERFACE
SW_SPEC
1
PPL-SPEC-000916
PPL-SPEC-000916
Checked typed special-value factory results

Let N be an admitted Checked_Number<T, Policy> marker-construction instantiation from 🔗 1. Checked special-marker construction and policy assignment. plus_infinity<N>(), minus_infinity<N>() and not_a_number<N>() shall construct and return an independently owned N from, respectively, PLUS_INFINITY, MINUS_INFINITY and NOT_A_NUMBER. The return type shall be exactly N. Admission shall require that the corresponding typed marker can implicitly construct N; these factory instantiations shall have the same scalar availability and policy capability conditions as that constructor.

Each call shall use Policy::ROUND_DEFAULT_CONSTRUCTOR and deliver the marker-construction Result exactly once to Policy::handle_result. No operator/function rounding default, additional conversion or return-copy handler decision shall be required. Copy elision shall not affect this count. Special payloads, finite fallback endpoints, unsupported-result meaning and valid reuse shall follow 🔗 1. Checked special-marker construction and policy assignment and its underlying marker contracts. A returned object after handler acceptance shall remain live, assignable and destructible; acceptance alone shall not promise a represented answer for an unsupported construction.

A handler exception shall propagate, and no result object shall be delivered. Normal cleanup shall preserve the owned-storage guarantees in 🔗 1. Same-type checked copying of admitted special values. Exception classification supplied by Extended_Number_Policy::handle_result shall retain 🔗 8. Exception classification of numerical result codes; an available NaN representation shall not prevent a policy from rejecting its construction result.

No existing numeric object shall be modified. The typed marker objects shall remain unchanged. Resource, scalar/policy, synchronization and backend conditions shall follow the corresponding marker constructor. No extra library initialization or coefficient-constant stage shall be required.

Special-value factories select the marker constructor already provided by the checked scalar policy and add ownership of the returned value.

APPROVED
NUMERICS
IF_CPP
Test, Analysis, Inspection

Check exact return types, all three markers across admitted native/GMP and configured floating storage, constructor-default directions and one handler call. Use policies without operator/function defaults, both infinity/NaN support choices, independent later result mutation and return-copy elision disabled. Check policy exceptions, cleanup and valid returned-object reuse without inspecting unsupported payloads.

src/Checked_Number_defs.hh; src/Checked_Number_inlines.hh; tests/checkedspecialfactoriesspec1.cc.

CPP
Public

Public header: <ppl.hh>; function-template instantiations in Parma_Polyhedra_Library for admitted checked N:

template <typename N>
N plus_infinity();

template <typename N>
N minus_infinity();

template <typename N>
N not_a_number();