31 int status = EXIT_SUCCESS;
34#if defined ITK_FUTURE_LEGACY_REMOVE
36 !std::is_same_v<itk::Array<char>, T>,
37 "Should not use the ambiguous 'char' stored in meta data, because it is not-cross platform consistent.");
39 !std::is_same_v<char, T>,
40 "Should not use the ambiguous 'char' stored in meta data, because it is not-cross platform consistent.");
43 std::cerr <<
"Failure ExposeMetaData for key '" << key <<
"'" << std::endl;
44 status = EXIT_FAILURE;
47 if constexpr (std::is_same_v<itk::Array<char>, T>)
57 if constexpr (std::is_signed_v<char>)
62 std::cerr <<
"Failure ExposeMetaData '" << key <<
"'" << std::endl;
63 status = EXIT_FAILURE;
65 exposedValue = temp_value;
72 std::cerr <<
"Failure ExposeMetaData '" << key <<
"'" << std::endl;
73 status = EXIT_FAILURE;
75 exposedValue = temp_value;
79 else if constexpr (std::is_same_v<char, T>)
89 if constexpr (std::is_signed_v<char>)
91 signed char temp_value{};
95 std::cerr <<
"Failure ExposeMetaData '" << key <<
"'" << std::endl;
96 status = EXIT_FAILURE;
98 exposedValue =
static_cast<T
>(temp_value);
102 unsigned char temp_value{};
105 std::cerr <<
"Failure ExposeMetaData '" << key <<
"'" << std::endl;
106 status = EXIT_FAILURE;
108 exposedValue =
static_cast<T
>(temp_value);
114 std::cerr <<
"Failure ExposeMetaData of boolean type '" << key <<
"'" << std::endl;
115 status = EXIT_FAILURE;
120 if constexpr (std::is_floating_point_v<T>)
124 std::cerr <<
"Incorrect meta value read in for " << key <<
" '" << exposedValue <<
"' != '" << knownValue <<
"'"
126 status = EXIT_FAILURE;
131 if (exposedValue != knownValue)
133 std::cerr <<
"Incorrect meta value read in for " << key <<
" '" << exposedValue <<
"' != '" << knownValue <<
"'"
135 status = EXIT_FAILURE;
138 if (status == EXIT_FAILURE)
140 std::cerr <<
"========================================" << std::endl;
141 metaDict.
Print(std::cerr);
142 std::cerr <<
"========================================" << std::endl;