spy v1.1.0
Julienne Aisner
 
Loading...
Searching...
No Matches

◆ data_model

constexpr auto spy::data_model = data_model_type{}
inlineconstexpr

Data Model reporting value.

The spy::data_model object can be compared to any other data model related value to verify if the code being compiled for a specific data model

Additionally, any of the data model related value are convertible to bool. They evaluates to true if they matches the correct data model currently used.

Supported Value

Name Data Model
spy::ilp32 ILP32
spy::lp32 LP32
spy::silp64 SILP64
spy::ilp64 ILP64
spy::llp64 LLP64
spy::lp64 LP64

Example

#include <spy/spy.hpp>
#include <iostream>
int main()
{
// Comparisons
if constexpr( spy::data_model == spy::ilp32_ ) std::cout << "This code is compiled on a ILP32 system\n";
else if constexpr( spy::data_model == spy::ilp64_ ) std::cout << "This code is compiled on a ILP64 system\n";
else if constexpr( spy::data_model == spy::lp64_ ) std::cout << "This code is compiled on a LP64 system\n";
// Direct test
if constexpr( spy::ilp32_ ) std::cout << "This code is compiled on a ILP32 system\n";
else if constexpr( spy::ilp64_ ) std::cout << "This code is compiled on a ILP64 system\n";
else if constexpr( spy::lp64_ ) std::cout << "This code is compiled on a LP64 system\n";
}
constexpr auto data_model
Data Model reporting value.
Definition: data_model.hpp:67