From 1a14004dcb96f30bbd46db6ed877b96fae6ca8e6 Mon Sep 17 00:00:00 2001 From: Aaron Webster Date: Tue, 2 Dec 2025 15:27:50 -0800 Subject: [PATCH 1/2] Port optimized conditionals v2 --- compiler/back_end/cpp/BUILD | 12 + compiler/back_end/cpp/build_defs.bzl | 5 +- .../back_end/cpp/generated_code_templates | 14 +- compiler/back_end/cpp/header_generator.py | 61 +- compiler/back_end/cpp/one_golden_test.py | 3 + compiler/back_end/cpp/run_one_golden_test.py | 16 +- .../testcode/many_conditionals_benchmark.cc | 45 + compiler/util/parser_types.py | 2 +- testdata/BUILD | 10 +- testdata/golden_cpp/alignments.emb.h | 164 +- testdata/golden_cpp/anonymous_bits.emb.h | 151 +- testdata/golden_cpp/auto_array_size.emb.h | 93 +- testdata/golden_cpp/bcd.emb.h | 193 ++- testdata/golden_cpp/bits.emb.h | 301 +++- testdata/golden_cpp/complex_offset.emb.h | 206 ++- testdata/golden_cpp/complex_structure.emb.h | 267 +++- testdata/golden_cpp/condition.emb.h | 1359 ++++++++++++----- testdata/golden_cpp/dynamic_size.emb.h | 543 +++++-- testdata/golden_cpp/enum.emb.h | 151 +- testdata/golden_cpp/enum_case.emb.h | 43 +- testdata/golden_cpp/explicit_sizes.emb.h | 158 +- testdata/golden_cpp/float.emb.h | 72 +- testdata/golden_cpp/imported.emb.h | 29 +- testdata/golden_cpp/imported_genfiles.emb.h | 29 +- testdata/golden_cpp/importer.emb.h | 36 +- testdata/golden_cpp/importer2.emb.h | 29 +- testdata/golden_cpp/inline_type.emb.h | 36 +- testdata/golden_cpp/int_sizes.emb.h | 78 +- testdata/golden_cpp/large_array.emb.h | 36 +- testdata/golden_cpp/nested_structure.emb.h | 115 +- testdata/golden_cpp/next_keyword.emb.h | 50 +- testdata/golden_cpp/no_enum_traits.emb.h | 192 +-- testdata/golden_cpp/parameters.emb.h | 570 +++++-- testdata/golden_cpp/requires.emb.h | 410 +++-- testdata/golden_cpp/start_size_range.emb.h | 50 +- testdata/golden_cpp/subtypes.emb.h | 214 ++- testdata/golden_cpp/text_format.emb.h | 122 +- testdata/golden_cpp/uint_sizes.emb.h | 476 ++++-- testdata/golden_cpp/virtual_field.emb.h | 916 +++++++---- testdata/many_conditionals.emb | 305 ++++ 40 files changed, 5455 insertions(+), 2107 deletions(-) create mode 100644 compiler/back_end/cpp/testcode/many_conditionals_benchmark.cc create mode 100644 testdata/many_conditionals.emb diff --git a/compiler/back_end/cpp/BUILD b/compiler/back_end/cpp/BUILD index 14eac6a..5e23832 100644 --- a/compiler/back_end/cpp/BUILD +++ b/compiler/back_end/cpp/BUILD @@ -388,6 +388,17 @@ emboss_cc_test( ], ) +emboss_cc_test( + name = "many_conditionals_benchmark", + srcs = [ + "testcode/many_conditionals_benchmark.cc", + ], + deps = [ + "//testdata:many_conditionals_emboss", + "@com_google_googletest//:gtest_main", + ], +) + # New golden test infrastructure py_library( name = "one_golden_test_lib", @@ -535,6 +546,7 @@ cpp_golden_test( cpp_golden_test( name = "no_enum_traits_golden_test", emb_file = "//testdata:no_enum_traits.emb", + extra_args = ["--no-cc-enum-traits"], golden_file = "//testdata/golden_cpp:no_enum_traits.emb.h", ) diff --git a/compiler/back_end/cpp/build_defs.bzl b/compiler/back_end/cpp/build_defs.bzl index 78d22f3..3775466 100644 --- a/compiler/back_end/cpp/build_defs.bzl +++ b/compiler/back_end/cpp/build_defs.bzl @@ -46,7 +46,7 @@ def emboss_cc_test(name, copts = None, no_w_sign_compare = False, **kwargs): **kwargs ) -def cpp_golden_test(name, emb_file, golden_file, import_dirs = []): +def cpp_golden_test(name, emb_file, golden_file, import_dirs = [], extra_args = []): """Defines a C++ golden file test. Args: @@ -54,6 +54,7 @@ def cpp_golden_test(name, emb_file, golden_file, import_dirs = []): emb_file: The .emb file to test. golden_file: The golden .h file. import_dirs: A list of import directories. + extra_args: A list of extra arguments to pass to the compiler. """ py_test( name = name, @@ -65,7 +66,7 @@ def cpp_golden_test(name, emb_file, golden_file, import_dirs = []): "$(location :emboss_codegen_cpp)", "$(location %s)" % emb_file, "$(location %s)" % golden_file, - ] + ["--import-dir=" + d for d in import_dirs], + ] + ["--import-dir=" + d for d in import_dirs] + extra_args, data = [ "//compiler/front_end:emboss_front_end", ":emboss_codegen_cpp", diff --git a/compiler/back_end/cpp/generated_code_templates b/compiler/back_end/cpp/generated_code_templates index e8f7c46..5ea3ca5 100644 --- a/compiler/back_end/cpp/generated_code_templates +++ b/compiler/back_end/cpp/generated_code_templates @@ -127,6 +127,7 @@ class Generic${name}View final { bool Ok() const { if (!IsComplete()) return false; ${parameter_ok_checks} +${ok_subexpressions} ${field_ok_checks} ${requires_check} return true; @@ -391,11 +392,14 @@ ${write_fields} // ** ok_method_test ** //////////////////////////////////////////////////////// // If we don't have enough information to determine whether ${field} is // present in the structure, then structure.Ok() should be false. - if (!has_${field}.Known()) return false; - // If ${field} is present, but not Ok(), then structure.Ok() should be - // false. If ${field} is not present, it does not matter whether it is - // Ok(). - if (has_${field}.ValueOrDefault() && !${field}.Ok()) return false; + { + const auto emboss_reserved_local_field_present = ${existence_condition}; + if (!emboss_reserved_local_field_present.Known()) return false; + // If ${field} is present, but not Ok(), then structure.Ok() should be + // false. If ${field} is not present, it does not matter whether it is + // Ok(). + if (emboss_reserved_local_field_present.ValueOrDefault() && !${field}.Ok()) return false; + } // ** equals_method_test ** //////////////////////////////////////////////////// diff --git a/compiler/back_end/cpp/header_generator.py b/compiler/back_end/cpp/header_generator.py index 5860bc8..8e504ad 100644 --- a/compiler/back_end/cpp/header_generator.py +++ b/compiler/back_end/cpp/header_generator.py @@ -791,6 +791,44 @@ def subexprs(self): ] +class _UsageCountingStore(object): + """A mock SubexpressionStore that counts subexpression usage.""" + + def __init__(self): + self.counts = collections.defaultdict(int) + + def add(self, subexpr): + self.counts[subexpr] += 1 + return subexpr + + +class _SmartSubexpressionStore(object): + """A SubexpressionStore that only caches subexpressions used multiple times.""" + + def __init__(self, prefix, counts): + self._prefix = prefix + self._counts = counts + self._subexpr_to_name = {} + self._index_to_subexpr = [] + + def add(self, subexpr): + if self._counts[subexpr] <= 1: + return subexpr + + if subexpr not in self._subexpr_to_name: + self._index_to_subexpr.append(subexpr) + self._subexpr_to_name[subexpr] = self._prefix + str( + len(self._index_to_subexpr) + ) + return self._subexpr_to_name[subexpr] + + def subexprs(self): + return [ + (self._subexpr_to_name[subexpr], subexpr) + for subexpr in self._index_to_subexpr + ] + + _ExpressionResult = collections.namedtuple( "ExpressionResult", ["rendered", "is_constant"] ) @@ -871,7 +909,9 @@ def _render_expression(expression, ir, field_reader=None, subexpressions=None): def _render_existence_test(field, ir, subexpressions=None): - return _render_expression(field.existence_condition, ir, subexpressions) + return _render_expression( + field.existence_condition, ir, subexpressions=subexpressions + ) def _alignment_of_location(location): @@ -1421,6 +1461,16 @@ def _generate_structure_definition(type_ir, ir, config: Config): initialize_parameters_initialized_true = "" parameter_checks = [""] + # Pass 1: Count subexpression usage. + ok_usage_counter = _UsageCountingStore() + for field_index in type_ir.structure.fields_in_dependency_order: + field = type_ir.structure.field[field_index] + _render_existence_test(field, ir, ok_usage_counter) + + # Pass 2: Generate code using smart store. + ok_subexpressions = _SmartSubexpressionStore( + "emboss_reserved_local_ok_subexpr_", ok_usage_counter.counts + ) for field_index in type_ir.structure.fields_in_dependency_order: field = type_ir.structure.field[field_index] helper_types, declaration, definition = _generate_structure_field_methods( @@ -1432,6 +1482,9 @@ def _generate_structure_definition(type_ir, ir, config: Config): code_template.format_template( _TEMPLATES.ok_method_test, field=_cpp_field_name(field.name.name.text) + "()", + existence_condition=_render_existence_test( + field, ir, subexpressions=ok_subexpressions + ).rendered, ) ) if not ir_util.field_is_virtual(field): @@ -1499,6 +1552,12 @@ def _generate_structure_definition(type_ir, ir, config: Config): size_method=_render_size_method(type_ir.structure.field, ir), field_method_declarations="".join(field_method_declarations), field_ok_checks="\n".join(ok_method_clauses), + ok_subexpressions="".join( + [ + " const auto {} = {};\n".format(name, subexpr) + for name, subexpr in ok_subexpressions.subexprs() + ] + ), parameter_ok_checks="\n".join(parameter_checks), requires_check=requires_check, equals_method_body="\n".join(equals_method_clauses), diff --git a/compiler/back_end/cpp/one_golden_test.py b/compiler/back_end/cpp/one_golden_test.py index 196e4a2..6c65491 100644 --- a/compiler/back_end/cpp/one_golden_test.py +++ b/compiler/back_end/cpp/one_golden_test.py @@ -27,6 +27,7 @@ def __init__( emb_file, golden_file, include_dirs=None, + compiler_flags=None, ): super(OneGoldenTest, self).__init__("test_golden_file") self.emboss_front_end = emboss_front_end @@ -34,6 +35,7 @@ def __init__( self.emb_file = emb_file self.golden_file = golden_file self.include_dirs = include_dirs if include_dirs is not None else [] + self.compiler_flags = compiler_flags if compiler_flags is not None else [] def test_golden_file(self): temp_dir = os.environ.get("TEST_TMPDIR", "") @@ -61,6 +63,7 @@ def test_golden_file(self): "--output-file", output_path, ] + compiler_args.extend(self.compiler_flags) process = subprocess.run(compiler_args, capture_output=True, text=True) diff --git a/compiler/back_end/cpp/run_one_golden_test.py b/compiler/back_end/cpp/run_one_golden_test.py index 36f166e..0faa513 100644 --- a/compiler/back_end/cpp/run_one_golden_test.py +++ b/compiler/back_end/cpp/run_one_golden_test.py @@ -34,12 +34,24 @@ def main(argv): emboss_compiler = argv[2] emb_file = argv[3] golden_file = argv[4] - include_dirs = argv[5:] + + include_dirs = [] + compiler_flags = [] + for arg in argv[5:]: + if arg.startswith("--import-dir="): + include_dirs.append(arg[len("--import-dir=") :]) + else: + compiler_flags.append(arg) suite = unittest.TestSuite() suite.addTest( OneGoldenTest( - emboss_front_end, emboss_compiler, emb_file, golden_file, include_dirs + emboss_front_end, + emboss_compiler, + emb_file, + golden_file, + include_dirs, + compiler_flags, ) ) runner = unittest.TextTestRunner() diff --git a/compiler/back_end/cpp/testcode/many_conditionals_benchmark.cc b/compiler/back_end/cpp/testcode/many_conditionals_benchmark.cc new file mode 100644 index 0000000..bc4ab96 --- /dev/null +++ b/compiler/back_end/cpp/testcode/many_conditionals_benchmark.cc @@ -0,0 +1,45 @@ +#include + +#include +#include +#include + +#include "testdata/many_conditionals.emb.h" + +// A simple test that acts as a benchmark/sanity check. +// Since this file is in compiler/back_end/cpp/testcode/, it will be built as a +// cc_test. We can use GoogleTest macros. + +namespace emboss { +namespace test { +namespace { + +TEST(ComplexConditionals, PerformanceBenchmark) { + std::vector buffer(100, 0); + auto view = emboss::test::MakeLargeConditionalsView(&buffer); + + auto start = std::chrono::high_resolution_clock::now(); + int iterations = 10000; + volatile bool result = false; + for (int i = 0; i < iterations; ++i) { + for (int tag = 0; tag < 100; ++tag) { + view.tag().Write(tag); + result = view.Ok(); + } + } + auto end = std::chrono::high_resolution_clock::now(); + + std::chrono::duration elapsed = end - start; + // We don't strictly fail on time, but we print it. + // In a real CI system we might assert upper bounds. + std::cout << "Time for " << iterations + << " iterations (x100 tags): " << elapsed.count() << "s" + << std::endl; + + EXPECT_TRUE(result); + EXPECT_TRUE(view.Ok()); +} + +} // namespace +} // namespace test +} // namespace emboss diff --git a/compiler/util/parser_types.py b/compiler/util/parser_types.py index a3ef34d..89cb186 100644 --- a/compiler/util/parser_types.py +++ b/compiler/util/parser_types.py @@ -15,7 +15,7 @@ """Types related to the LR(1) parser. This module contains types used by the LR(1) parser, which are also used in -other parts of the compiler: +other parts of the compiler: SourcePosition: a position (zero-width) within a source file. SourceLocation: a span within a source file. diff --git a/testdata/BUILD b/testdata/BUILD index 95716da..8498fe5 100644 --- a/testdata/BUILD +++ b/testdata/BUILD @@ -36,11 +36,8 @@ filegroup( ], ) - - exports_files(glob(["**/*.emb"])) - filegroup( name = "test_embs", srcs = [ @@ -369,3 +366,10 @@ emboss_cc_library( "complex_offset.emb", ], ) + +emboss_cc_library( + name = "many_conditionals_emboss", + srcs = [ + "many_conditionals.emb", + ], +) diff --git a/testdata/golden_cpp/alignments.emb.h b/testdata/golden_cpp/alignments.emb.h index e60daf5..f225198 100644 --- a/testdata/golden_cpp/alignments.emb.h +++ b/testdata/golden_cpp/alignments.emb.h @@ -116,60 +116,103 @@ class GenericAlignmentsView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_zero_offset().Known()) return false; - if (has_zero_offset().ValueOrDefault() && !zero_offset().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !zero_offset().Ok()) return false; + } - if (!has_zero_offset_substructure().Known()) return false; - if (has_zero_offset_substructure().ValueOrDefault() && !zero_offset_substructure().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !zero_offset_substructure().Ok()) return false; + } - if (!has_two_offset_substructure().Known()) return false; - if (has_two_offset_substructure().ValueOrDefault() && !two_offset_substructure().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !two_offset_substructure().Ok()) return false; + } - if (!has_three_offset().Known()) return false; - if (has_three_offset().ValueOrDefault() && !three_offset().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !three_offset().Ok()) return false; + } - if (!has_four_offset().Known()) return false; - if (has_four_offset().ValueOrDefault() && !four_offset().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !four_offset().Ok()) return false; + } - if (!has_eleven_offset().Known()) return false; - if (has_eleven_offset().ValueOrDefault() && !eleven_offset().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !eleven_offset().Ok()) return false; + } - if (!has_twelve_offset().Known()) return false; - if (has_twelve_offset().ValueOrDefault() && !twelve_offset().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !twelve_offset().Ok()) return false; + } - if (!has_zero_offset_four_stride_array().Known()) return false; - if (has_zero_offset_four_stride_array().ValueOrDefault() && !zero_offset_four_stride_array().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !zero_offset_four_stride_array().Ok()) return false; + } - if (!has_zero_offset_six_stride_array().Known()) return false; - if (has_zero_offset_six_stride_array().ValueOrDefault() && !zero_offset_six_stride_array().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !zero_offset_six_stride_array().Ok()) return false; + } - if (!has_three_offset_four_stride_array().Known()) return false; - if (has_three_offset_four_stride_array().ValueOrDefault() && !three_offset_four_stride_array().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !three_offset_four_stride_array().Ok()) return false; + } - if (!has_four_offset_six_stride_array().Known()) return false; - if (has_four_offset_six_stride_array().ValueOrDefault() && !four_offset_six_stride_array().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !four_offset_six_stride_array().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -1338,20 +1381,33 @@ class GenericPlaceholder4View final { bool Ok() const { if (!IsComplete()) return false; - if (!has_dummy().Known()) return false; - if (has_dummy().ValueOrDefault() && !dummy().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !dummy().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -1757,24 +1813,40 @@ class GenericPlaceholder6View final { bool Ok() const { if (!IsComplete()) return false; - if (!has_zero_offset().Known()) return false; - if (has_zero_offset().ValueOrDefault() && !zero_offset().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !zero_offset().Ok()) return false; + } - if (!has_two_offset().Known()) return false; - if (has_two_offset().ValueOrDefault() && !two_offset().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !two_offset().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/anonymous_bits.emb.h b/testdata/golden_cpp/anonymous_bits.emb.h index 7d505c9..42b1aac 100644 --- a/testdata/golden_cpp/anonymous_bits.emb.h +++ b/testdata/golden_cpp/anonymous_bits.emb.h @@ -122,28 +122,47 @@ class GenericEmbossReservedAnonymousField2View final { bool Ok() const { if (!IsComplete()) return false; - if (!has_high_bit().Known()) return false; - if (has_high_bit().ValueOrDefault() && !high_bit().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !high_bit().Ok()) return false; + } - if (!has_bar().Known()) return false; - if (has_bar().ValueOrDefault() && !bar().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !bar().Ok()) return false; + } - if (!has_first_bit().Known()) return false; - if (has_first_bit().ValueOrDefault() && !first_bit().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !first_bit().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -793,24 +812,40 @@ class GenericEmbossReservedAnonymousField1View final { bool Ok() const { if (!IsComplete()) return false; - if (!has_bit_23().Known()) return false; - if (has_bit_23().ValueOrDefault() && !bit_23().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !bit_23().Ok()) return false; + } - if (!has_low_bit().Known()) return false; - if (has_low_bit().ValueOrDefault() && !low_bit().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !low_bit().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -1288,44 +1323,76 @@ class GenericFooView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_emboss_reserved_anonymous_field_2().Known()) return false; - if (has_emboss_reserved_anonymous_field_2().ValueOrDefault() && !emboss_reserved_anonymous_field_2().Ok()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_2().Ok()) return false; + } - if (!has_high_bit().Known()) return false; - if (has_high_bit().ValueOrDefault() && !high_bit().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !high_bit().Ok()) return false; + } - if (!has_bar().Known()) return false; - if (has_bar().ValueOrDefault() && !bar().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !bar().Ok()) return false; + } - if (!has_first_bit().Known()) return false; - if (has_first_bit().ValueOrDefault() && !first_bit().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !first_bit().Ok()) return false; + } - if (!has_emboss_reserved_anonymous_field_1().Known()) return false; - if (has_emboss_reserved_anonymous_field_1().ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; + } - if (!has_bit_23().Known()) return false; - if (has_bit_23().ValueOrDefault() && !bit_23().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !bit_23().Ok()) return false; + } - if (!has_low_bit().Known()) return false; - if (has_low_bit().ValueOrDefault() && !low_bit().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !low_bit().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/auto_array_size.emb.h b/testdata/golden_cpp/auto_array_size.emb.h index 64e2973..66e01f0 100644 --- a/testdata/golden_cpp/auto_array_size.emb.h +++ b/testdata/golden_cpp/auto_array_size.emb.h @@ -99,24 +99,40 @@ class GenericElementView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -602,36 +618,61 @@ class GenericAutoSizeView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_array_size().Known()) return false; - if (has_array_size().ValueOrDefault() && !array_size().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !array_size().Ok()) return false; + } - if (!has_four_byte_array().Known()) return false; - if (has_four_byte_array().ValueOrDefault() && !four_byte_array().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !four_byte_array().Ok()) return false; + } - if (!has_four_struct_array().Known()) return false; - if (has_four_struct_array().ValueOrDefault() && !four_struct_array().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !four_struct_array().Ok()) return false; + } - if (!has_dynamic_byte_array().Known()) return false; - if (has_dynamic_byte_array().ValueOrDefault() && !dynamic_byte_array().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !dynamic_byte_array().Ok()) return false; + } - if (!has_dynamic_struct_array().Known()) return false; - if (has_dynamic_struct_array().ValueOrDefault() && !dynamic_struct_array().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !dynamic_struct_array().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/bcd.emb.h b/testdata/golden_cpp/bcd.emb.h index 1e4edc2..c10e884 100644 --- a/testdata/golden_cpp/bcd.emb.h +++ b/testdata/golden_cpp/bcd.emb.h @@ -125,32 +125,54 @@ class GenericEmbossReservedAnonymousField1View final { bool Ok() const { if (!IsComplete()) return false; - if (!has_four_bit().Known()) return false; - if (has_four_bit().ValueOrDefault() && !four_bit().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !four_bit().Ok()) return false; + } - if (!has_six_bit().Known()) return false; - if (has_six_bit().ValueOrDefault() && !six_bit().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !six_bit().Ok()) return false; + } - if (!has_ten_bit().Known()) return false; - if (has_ten_bit().ValueOrDefault() && !ten_bit().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !ten_bit().Ok()) return false; + } - if (!has_twelve_bit().Known()) return false; - if (has_twelve_bit().ValueOrDefault() && !twelve_bit().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !twelve_bit().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -782,68 +804,118 @@ class GenericBcdSizesView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; + } - if (!has_two_byte().Known()) return false; - if (has_two_byte().ValueOrDefault() && !two_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !two_byte().Ok()) return false; + } - if (!has_three_byte().Known()) return false; - if (has_three_byte().ValueOrDefault() && !three_byte().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !three_byte().Ok()) return false; + } - if (!has_four_byte().Known()) return false; - if (has_four_byte().ValueOrDefault() && !four_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !four_byte().Ok()) return false; + } - if (!has_five_byte().Known()) return false; - if (has_five_byte().ValueOrDefault() && !five_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !five_byte().Ok()) return false; + } - if (!has_six_byte().Known()) return false; - if (has_six_byte().ValueOrDefault() && !six_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !six_byte().Ok()) return false; + } - if (!has_seven_byte().Known()) return false; - if (has_seven_byte().ValueOrDefault() && !seven_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !seven_byte().Ok()) return false; + } - if (!has_eight_byte().Known()) return false; - if (has_eight_byte().ValueOrDefault() && !eight_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !eight_byte().Ok()) return false; + } - if (!has_emboss_reserved_anonymous_field_1().Known()) return false; - if (has_emboss_reserved_anonymous_field_1().ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; + } - if (!has_four_bit().Known()) return false; - if (has_four_bit().ValueOrDefault() && !four_bit().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !four_bit().Ok()) return false; + } - if (!has_six_bit().Known()) return false; - if (has_six_bit().ValueOrDefault() && !six_bit().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !six_bit().Ok()) return false; + } - if (!has_ten_bit().Known()) return false; - if (has_ten_bit().ValueOrDefault() && !ten_bit().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !ten_bit().Ok()) return false; + } - if (!has_twelve_bit().Known()) return false; - if (has_twelve_bit().ValueOrDefault() && !twelve_bit().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !twelve_bit().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -2004,20 +2076,33 @@ class GenericBcdBigEndianView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_four_byte().Known()) return false; - if (has_four_byte().ValueOrDefault() && !four_byte().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !four_byte().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/bits.emb.h b/testdata/golden_cpp/bits.emb.h index e6f29da..1509726 100644 --- a/testdata/golden_cpp/bits.emb.h +++ b/testdata/golden_cpp/bits.emb.h @@ -142,36 +142,61 @@ class GenericOneByteView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_high_bit().Known()) return false; - if (has_high_bit().ValueOrDefault() && !high_bit().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !high_bit().Ok()) return false; + } - if (!has_less_high_bit().Known()) return false; - if (has_less_high_bit().ValueOrDefault() && !less_high_bit().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !less_high_bit().Ok()) return false; + } - if (!has_mid_nibble().Known()) return false; - if (has_mid_nibble().ValueOrDefault() && !mid_nibble().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !mid_nibble().Ok()) return false; + } - if (!has_less_low_bit().Known()) return false; - if (has_less_low_bit().ValueOrDefault() && !less_low_bit().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !less_low_bit().Ok()) return false; + } - if (!has_low_bit().Known()) return false; - if (has_low_bit().ValueOrDefault() && !low_bit().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !low_bit().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -907,28 +932,47 @@ class GenericTwoByteWithGapsView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_high_bit().Known()) return false; - if (has_high_bit().ValueOrDefault() && !high_bit().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !high_bit().Ok()) return false; + } - if (!has_mid_nibble().Known()) return false; - if (has_mid_nibble().ValueOrDefault() && !mid_nibble().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !mid_nibble().Ok()) return false; + } - if (!has_low_bit().Known()) return false; - if (has_low_bit().ValueOrDefault() && !low_bit().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !low_bit().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -1483,36 +1527,61 @@ class GenericFourByteView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_high_nibble().Known()) return false; - if (has_high_nibble().ValueOrDefault() && !high_nibble().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !high_nibble().Ok()) return false; + } - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; + } - if (!has_two_byte().Known()) return false; - if (has_two_byte().ValueOrDefault() && !two_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !two_byte().Ok()) return false; + } - if (!has_raw_low_nibble().Known()) return false; - if (has_raw_low_nibble().ValueOrDefault() && !raw_low_nibble().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !raw_low_nibble().Ok()) return false; + } - if (!has_low_nibble().Known()) return false; - if (has_low_nibble().ValueOrDefault() && !low_nibble().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !low_nibble().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -2274,24 +2343,40 @@ class GenericArrayInBitsView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_lone_flag().Known()) return false; - if (has_lone_flag().ValueOrDefault() && !lone_flag().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !lone_flag().Ok()) return false; + } - if (!has_flags().Known()) return false; - if (has_flags().ValueOrDefault() && !flags().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !flags().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -2777,20 +2862,33 @@ class GenericArrayInBitsInStructView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_array_in_bits().Known()) return false; - if (has_array_in_bits().ValueOrDefault() && !array_in_bits().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !array_in_bits().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -3196,32 +3294,54 @@ class GenericStructOfBitsView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; + } - if (!has_two_byte().Known()) return false; - if (has_two_byte().ValueOrDefault() && !two_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !two_byte().Ok()) return false; + } - if (!has_four_byte().Known()) return false; - if (has_four_byte().ValueOrDefault() && !four_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !four_byte().Ok()) return false; + } - if (!has_located_byte().Known()) return false; - if (has_located_byte().ValueOrDefault() && !located_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !located_byte().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -3881,20 +4001,33 @@ class GenericBitArrayView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/complex_offset.emb.h b/testdata/golden_cpp/complex_offset.emb.h index 31889b0..e478bf3 100644 --- a/testdata/golden_cpp/complex_offset.emb.h +++ b/testdata/golden_cpp/complex_offset.emb.h @@ -106,20 +106,33 @@ class GenericLengthView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_length().Known()) return false; - if (has_length().ValueOrDefault() && !length().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !length().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -525,24 +538,40 @@ class GenericDataView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_length().Known()) return false; - if (has_length().ValueOrDefault() && !length().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !length().Ok()) return false; + } - if (!has_data().Known()) return false; - if (has_data().ValueOrDefault() && !data().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !data().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -1072,84 +1101,145 @@ class GenericPackedFieldsView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_length1().Known()) return false; - if (has_length1().ValueOrDefault() && !length1().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !length1().Ok()) return false; + } - if (!has_data1().Known()) return false; - if (has_data1().ValueOrDefault() && !data1().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !data1().Ok()) return false; + } - if (!has_o1().Known()) return false; - if (has_o1().ValueOrDefault() && !o1().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !o1().Ok()) return false; + } - if (!has_length2().Known()) return false; - if (has_length2().ValueOrDefault() && !length2().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !length2().Ok()) return false; + } - if (!has_data2().Known()) return false; - if (has_data2().ValueOrDefault() && !data2().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !data2().Ok()) return false; + } - if (!has_o2().Known()) return false; - if (has_o2().ValueOrDefault() && !o2().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !o2().Ok()) return false; + } - if (!has_length3().Known()) return false; - if (has_length3().ValueOrDefault() && !length3().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !length3().Ok()) return false; + } - if (!has_data3().Known()) return false; - if (has_data3().ValueOrDefault() && !data3().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !data3().Ok()) return false; + } - if (!has_o3().Known()) return false; - if (has_o3().ValueOrDefault() && !o3().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !o3().Ok()) return false; + } - if (!has_length4().Known()) return false; - if (has_length4().ValueOrDefault() && !length4().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !length4().Ok()) return false; + } - if (!has_data4().Known()) return false; - if (has_data4().ValueOrDefault() && !data4().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !data4().Ok()) return false; + } - if (!has_o4().Known()) return false; - if (has_o4().ValueOrDefault() && !o4().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !o4().Ok()) return false; + } - if (!has_length5().Known()) return false; - if (has_length5().ValueOrDefault() && !length5().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !length5().Ok()) return false; + } - if (!has_data5().Known()) return false; - if (has_data5().ValueOrDefault() && !data5().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !data5().Ok()) return false; + } - if (!has_o5().Known()) return false; - if (has_o5().ValueOrDefault() && !o5().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !o5().Ok()) return false; + } - if (!has_length6().Known()) return false; - if (has_length6().ValueOrDefault() && !length6().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !length6().Ok()) return false; + } - if (!has_data6().Known()) return false; - if (has_data6().ValueOrDefault() && !data6().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !data6().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/complex_structure.emb.h b/testdata/golden_cpp/complex_structure.emb.h index 745976a..2ea9495 100644 --- a/testdata/golden_cpp/complex_structure.emb.h +++ b/testdata/golden_cpp/complex_structure.emb.h @@ -115,28 +115,47 @@ class GenericRegisterLayoutView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_l().Known()) return false; - if (has_l().ValueOrDefault() && !l().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !l().Ok()) return false; + } - if (!has_h().Known()) return false; - if (has_h().ValueOrDefault() && !h().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !h().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -695,20 +714,33 @@ class GenericArrayElementView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -1134,32 +1166,54 @@ class GenericEmbossReservedAnonymousField1View final { bool Ok() const { if (!IsComplete()) return false; - if (!has_a0().Known()) return false; - if (has_a0().ValueOrDefault() && !a0().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a0().Ok()) return false; + } - if (!has_s0().Known()) return false; - if (has_s0().ValueOrDefault() && !s0().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !s0().Ok()) return false; + } - if (!has_l0().Known()) return false; - if (has_l0().ValueOrDefault() && !l0().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !l0().Ok()) return false; + } - if (!has_h0().Known()) return false; - if (has_h0().ValueOrDefault() && !h0().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !h0().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -1791,84 +1845,149 @@ class GenericComplexView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_s().Known()) return false; - if (has_s().ValueOrDefault() && !s().Ok()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); + const auto emboss_reserved_local_ok_subexpr_2 = a0(); + const auto emboss_reserved_local_ok_subexpr_3 = b2(); + const auto emboss_reserved_local_ok_subexpr_4 = s(); + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !s().Ok()) return false; + } - if (!has_u().Known()) return false; - if (has_u().ValueOrDefault() && !u().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !u().Ok()) return false; + } - if (!has_i().Known()) return false; - if (has_i().ValueOrDefault() && !i().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !i().Ok()) return false; + } - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_emboss_reserved_anonymous_field_1().Known()) return false; - if (has_emboss_reserved_anonymous_field_1().ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; + } - if (!has_a0().Known()) return false; - if (has_a0().ValueOrDefault() && !a0().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a0().Ok()) return false; + } - if (!has_s0().Known()) return false; - if (has_s0().ValueOrDefault() && !s0().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !s0().Ok()) return false; + } - if (!has_l0().Known()) return false; - if (has_l0().ValueOrDefault() && !l0().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !l0().Ok()) return false; + } - if (!has_h0().Known()) return false; - if (has_h0().ValueOrDefault() && !h0().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !h0().Ok()) return false; + } - if (!has_e1().Known()) return false; - if (has_e1().ValueOrDefault() && !e1().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !e1().Ok()) return false; + } - if (!has_e2().Known()) return false; - if (has_e2().ValueOrDefault() && !e2().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThanOrEqual((emboss_reserved_local_ok_subexpr_2.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_2.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(128LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !e2().Ok()) return false; + } - if (!has_b2().Known()) return false; - if (has_b2().ValueOrDefault() && !b2().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::LessThan((emboss_reserved_local_ok_subexpr_2.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_2.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(128LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b2().Ok()) return false; + } - if (!has_e3().Known()) return false; - if (has_e3().ValueOrDefault() && !e3().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThan((emboss_reserved_local_ok_subexpr_3.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_3.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(25LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !e3().Ok()) return false; + } - if (!has_e4().Known()) return false; - if (has_e4().ValueOrDefault() && !e4().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::GreaterThanOrEqual((emboss_reserved_local_ok_subexpr_4.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_4.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(4LL))), ::emboss::support::Choice(::emboss::support::GreaterThanOrEqual((emboss_reserved_local_ok_subexpr_2.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_2.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(80LL))), ::emboss::support::GreaterThanOrEqual((e3().Ok() ? ::emboss::support::Maybe(static_cast(e3().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(128LL))), ::emboss::support::LessThan((emboss_reserved_local_ok_subexpr_3.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_3.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(50LL))))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !e4().Ok()) return false; + } - if (!has_e5().Known()) return false; - if (has_e5().ValueOrDefault() && !e5().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::GreaterThanOrEqual((emboss_reserved_local_ok_subexpr_4.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_4.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(5LL))), ::emboss::support::GreaterThan((e4().Ok() ? ::emboss::support::Maybe(static_cast(e4().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL)))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !e5().Ok()) return false; + } - if (!has_e0().Known()) return false; - if (has_e0().ValueOrDefault() && !e0().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Or(::emboss::support::LessThan((emboss_reserved_local_ok_subexpr_4.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_4.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(2LL))), ::emboss::support::LessThan((emboss_reserved_local_ok_subexpr_2.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_2.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(4LL)))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !e0().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/condition.emb.h b/testdata/golden_cpp/condition.emb.h index 9d11fb7..1ba3f50 100644 --- a/testdata/golden_cpp/condition.emb.h +++ b/testdata/golden_cpp/condition.emb.h @@ -360,24 +360,40 @@ class GenericBasicConditionalView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -890,24 +906,40 @@ class GenericNegativeConditionalView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::NotEqual((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -1421,28 +1453,47 @@ class GenericConditionalAndUnconditionalOverlappingFinalFieldView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_z().Known()) return false; - if (has_z().ValueOrDefault() && !z().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !z().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -2002,24 +2053,40 @@ class GenericConditionalBasicConditionalFieldFirstView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -2503,28 +2570,47 @@ class GenericConditionalAndDynamicLocationView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -3117,24 +3203,40 @@ class GenericConditionUsesMinIntView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal(::emboss::support::Difference((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(9223372036854775680LL))), ::emboss::support::Maybe(static_cast(-9223372036854775807LL - 1))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -3649,28 +3751,47 @@ class GenericNestedConditionalView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_xcc().Known()) return false; - if (has_xcc().ValueOrDefault() && !xcc().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal((xc().Ok() ? ::emboss::support::Maybe(static_cast(xc().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xcc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -4265,28 +4386,48 @@ class GenericCorrectNestedConditionalView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = x(); + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_xcc().Known()) return false; - if (has_xcc().ValueOrDefault() && !xcc().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))), ::emboss::support::Equal((xc().Ok() ? ::emboss::support::Maybe(static_cast(xc().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL)))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xcc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -4881,24 +5022,40 @@ class GenericAlwaysFalseConditionView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(false); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -5380,20 +5537,33 @@ class GenericOnlyAlwaysFalseConditionView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(false); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -5797,16 +5967,26 @@ class GenericEmptyStructView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -6140,28 +6320,47 @@ class GenericAlwaysFalseConditionDynamicSizeView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(false); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -6752,28 +6951,47 @@ class GenericConditionDoesNotContributeToSizeView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -7421,28 +7639,48 @@ class GenericEnumConditionView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = x(); + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(1))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_xc2().Known()) return false; - if (has_xc2().ValueOrDefault() && !xc2().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThan((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc2().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -8035,24 +8273,40 @@ class GenericNegativeEnumConditionView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::NotEqual((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(1))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -8566,24 +8820,40 @@ class GenericLessThanConditionView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::LessThan((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(5LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -9096,24 +9366,40 @@ class GenericLessThanOrEqualConditionView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::LessThanOrEqual((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(5LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -9626,24 +9912,40 @@ class GenericGreaterThanOrEqualConditionView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThanOrEqual((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(5LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -10156,24 +10458,40 @@ class GenericGreaterThanConditionView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThan((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(5LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -10687,28 +11005,49 @@ class GenericRangeConditionView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = y(); + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::And(::emboss::support::LessThan(::emboss::support::Maybe(static_cast(5LL)), (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe())), ::emboss::support::LessThanOrEqual((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), (emboss_reserved_local_ok_subexpr_2.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_2.UncheckedRead())) : ::emboss::support::Maybe()))), ::emboss::support::LessThan((emboss_reserved_local_ok_subexpr_2.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_2.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(10LL)))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -11305,28 +11644,49 @@ class GenericReverseRangeConditionView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = y(); + const auto emboss_reserved_local_ok_subexpr_2 = x(); + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::And(::emboss::support::GreaterThan(::emboss::support::Maybe(static_cast(10LL)), (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe())), ::emboss::support::GreaterThanOrEqual((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), (emboss_reserved_local_ok_subexpr_2.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_2.UncheckedRead())) : ::emboss::support::Maybe()))), ::emboss::support::GreaterThan((emboss_reserved_local_ok_subexpr_2.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_2.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(5LL)))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -11923,28 +12283,47 @@ class GenericAndConditionView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::Equal((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(5LL))), ::emboss::support::Equal((y().Ok() ? ::emboss::support::Maybe(static_cast(y().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(5LL)))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -12539,28 +12918,47 @@ class GenericOrConditionView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Or(::emboss::support::Equal((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(5LL))), ::emboss::support::Equal((y().Ok() ? ::emboss::support::Maybe(static_cast(y().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(5LL)))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -13243,32 +13641,54 @@ class GenericChoiceConditionView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_field().Known()) return false; - if (has_field().ValueOrDefault() && !field().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !field().Ok()) return false; + } - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; + } - if (!has_xyc().Known()) return false; - if (has_xyc().ValueOrDefault() && !xyc().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal(::emboss::support::Choice(::emboss::support::Equal((field().Ok() ? ::emboss::support::Maybe(static_cast(field().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(1))), (x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), (y().Ok() ? ::emboss::support::Maybe(static_cast(y().UncheckedRead())) : ::emboss::support::Maybe())), ::emboss::support::Maybe(static_cast(5LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xyc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -13948,24 +14368,40 @@ class GenericEmbossReservedAnonymousField3View final { bool Ok() const { if (!IsComplete()) return false; - if (!has_has_top().Known()) return false; - if (has_has_top().ValueOrDefault() && !has_top().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !has_top().Ok()) return false; + } - if (!has_has_bottom().Known()) return false; - if (has_has_bottom().ValueOrDefault() && !has_bottom().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !has_bottom().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -14443,28 +14879,48 @@ class GenericContainsBitsView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_emboss_reserved_anonymous_field_3().Known()) return false; - if (has_emboss_reserved_anonymous_field_3().ValueOrDefault() && !emboss_reserved_anonymous_field_3().Ok()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_3().Ok()) return false; + } - if (!has_has_top().Known()) return false; - if (has_has_top().ValueOrDefault() && !has_top().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !has_top().Ok()) return false; + } - if (!has_has_bottom().Known()) return false; - if (has_has_bottom().ValueOrDefault() && !has_bottom().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !has_bottom().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -14920,24 +15376,40 @@ class GenericContainsContainsBitsView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_condition().Known()) return false; - if (has_condition().ValueOrDefault() && !condition().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !condition().Ok()) return false; + } - if (!has_top().Known()) return false; - if (has_top().ValueOrDefault() && !top().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal((condition().has_top().Ok() ? ::emboss::support::Maybe(static_cast(condition().has_top().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(1LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !top().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -15455,28 +15927,47 @@ class GenericType0View final { bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_c().Known()) return false; - if (has_c().ValueOrDefault() && !c().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !c().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -16038,28 +16529,47 @@ class GenericType1View final { bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_c().Known()) return false; - if (has_c().ValueOrDefault() && !c().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !c().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -16614,28 +17124,48 @@ class GenericConditionalInlineView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_payload_id().Known()) return false; - if (has_payload_id().ValueOrDefault() && !payload_id().Ok()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = payload_id(); + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !payload_id().Ok()) return false; + } - if (!has_type_0().Known()) return false; - if (has_type_0().ValueOrDefault() && !type_0().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !type_0().Ok()) return false; + } - if (!has_type_1().Known()) return false; - if (has_type_1().ValueOrDefault() && !type_1().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(1LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !type_1().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -17232,28 +17762,47 @@ class GenericEmbossReservedAnonymousField2View final { bool Ok() const { if (!IsComplete()) return false; - if (!has_low().Known()) return false; - if (has_low().ValueOrDefault() && !low().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !low().Ok()) return false; + } - if (!has_mid().Known()) return false; - if (has_mid().ValueOrDefault() && !mid().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal((low().Ok() ? ::emboss::support::Maybe(static_cast(low().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(1LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !mid().Ok()) return false; + } - if (!has_high().Known()) return false; - if (has_high().ValueOrDefault() && !high().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !high().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -17808,36 +18357,62 @@ class GenericConditionalAnonymousView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = has_emboss_reserved_anonymous_field_2(); + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_emboss_reserved_anonymous_field_2().Known()) return false; - if (has_emboss_reserved_anonymous_field_2().ValueOrDefault() && !emboss_reserved_anonymous_field_2().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThan((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(10LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_2().Ok()) return false; + } - if (!has_low().Known()) return false; - if (has_low().ValueOrDefault() && !low().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::And(emboss_reserved_local_ok_subexpr_1, ::emboss::support::Maybe(true)); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !low().Ok()) return false; + } - if (!has_mid().Known()) return false; - if (has_mid().ValueOrDefault() && !mid().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::And(emboss_reserved_local_ok_subexpr_1, emboss_reserved_anonymous_field_2().has_mid()); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !mid().Ok()) return false; + } - if (!has_high().Known()) return false; - if (has_high().ValueOrDefault() && !high().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::And(emboss_reserved_local_ok_subexpr_1, ::emboss::support::Maybe(true)); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !high().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -18450,20 +19025,33 @@ class GenericEmbossReservedAnonymousField1View final { bool Ok() const { if (!IsComplete()) return false; - if (!has_enabled().Known()) return false; - if (has_enabled().ValueOrDefault() && !enabled().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !enabled().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -18864,28 +19452,47 @@ class GenericConditionalOnFlagView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_emboss_reserved_anonymous_field_1().Known()) return false; - if (has_emboss_reserved_anonymous_field_1().ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; + } - if (!has_enabled().Known()) return false; - if (has_enabled().ValueOrDefault() && !enabled().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !enabled().Ok()) return false; + } - if (!has_value().Known()) return false; - if (has_value().ValueOrDefault() && !value().Ok()) return false; + { + const auto emboss_reserved_local_field_present = (enabled().Ok() ? ::emboss::support::Maybe(static_cast(enabled().UncheckedRead())) : ::emboss::support::Maybe()); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !value().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/dynamic_size.emb.h b/testdata/golden_cpp/dynamic_size.emb.h index 8c5f5b5..cfbe3b7 100644 --- a/testdata/golden_cpp/dynamic_size.emb.h +++ b/testdata/golden_cpp/dynamic_size.emb.h @@ -174,36 +174,61 @@ class GenericMessageView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_header_length().Known()) return false; - if (has_header_length().ValueOrDefault() && !header_length().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !header_length().Ok()) return false; + } - if (!has_message_length().Known()) return false; - if (has_message_length().ValueOrDefault() && !message_length().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !message_length().Ok()) return false; + } - if (!has_padding().Known()) return false; - if (has_padding().ValueOrDefault() && !padding().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !padding().Ok()) return false; + } - if (!has_message().Known()) return false; - if (has_message().ValueOrDefault() && !message().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !message().Ok()) return false; + } - if (!has_crc32().Known()) return false; - if (has_crc32().ValueOrDefault() && !crc32().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !crc32().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -962,24 +987,40 @@ class GenericImageView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_size().Known()) return false; - if (has_size().ValueOrDefault() && !size().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !size().Ok()) return false; + } - if (!has_pixels().Known()) return false; - if (has_pixels().ValueOrDefault() && !pixels().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !pixels().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -1509,40 +1550,68 @@ class GenericTwoRegionsView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_b_end().Known()) return false; - if (has_b_end().ValueOrDefault() && !b_end().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b_end().Ok()) return false; + } - if (!has_b_start().Known()) return false; - if (has_b_start().ValueOrDefault() && !b_start().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b_start().Ok()) return false; + } - if (!has_a_size().Known()) return false; - if (has_a_size().ValueOrDefault() && !a_size().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a_size().Ok()) return false; + } - if (!has_a_start().Known()) return false; - if (has_a_start().ValueOrDefault() && !a_start().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a_start().Ok()) return false; + } - if (!has_region_a().Known()) return false; - if (has_region_a().ValueOrDefault() && !region_a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !region_a().Ok()) return false; + } - if (!has_region_b().Known()) return false; - if (has_region_b().ValueOrDefault() && !region_b().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !region_b().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -2381,28 +2450,47 @@ class GenericMultipliedSizeView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_width().Known()) return false; - if (has_width().ValueOrDefault() && !width().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !width().Ok()) return false; + } - if (!has_height().Known()) return false; - if (has_height().ValueOrDefault() && !height().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !height().Ok()) return false; + } - if (!has_data().Known()) return false; - if (has_data().ValueOrDefault() && !data().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !data().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -3006,52 +3094,89 @@ class GenericNegativeTermsInSizesView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_c().Known()) return false; - if (has_c().ValueOrDefault() && !c().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !c().Ok()) return false; + } - if (!has_a_minus_b().Known()) return false; - if (has_a_minus_b().ValueOrDefault() && !a_minus_b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a_minus_b().Ok()) return false; + } - if (!has_a_minus_2b().Known()) return false; - if (has_a_minus_2b().ValueOrDefault() && !a_minus_2b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a_minus_2b().Ok()) return false; + } - if (!has_a_minus_b_minus_c().Known()) return false; - if (has_a_minus_b_minus_c().ValueOrDefault() && !a_minus_b_minus_c().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a_minus_b_minus_c().Ok()) return false; + } - if (!has_ten_minus_a().Known()) return false; - if (has_ten_minus_a().ValueOrDefault() && !ten_minus_a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !ten_minus_a().Ok()) return false; + } - if (!has_a_minus_2c().Known()) return false; - if (has_a_minus_2c().ValueOrDefault() && !a_minus_2c().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a_minus_2c().Ok()) return false; + } - if (!has_a_minus_c().Known()) return false; - if (has_a_minus_c().ValueOrDefault() && !a_minus_c().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a_minus_c().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -4154,24 +4279,40 @@ class GenericNegativeTermInLocationView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -4687,32 +4828,54 @@ class GenericChainedSizeView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_c().Known()) return false; - if (has_c().ValueOrDefault() && !c().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !c().Ok()) return false; + } - if (!has_d().Known()) return false; - if (has_d().ValueOrDefault() && !d().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !d().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -5388,28 +5551,47 @@ class GenericFinalFieldOverlapsView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_c().Known()) return false; - if (has_c().ValueOrDefault() && !c().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !c().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -5971,32 +6153,54 @@ class GenericDynamicFinalFieldOverlapsView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_c().Known()) return false; - if (has_c().ValueOrDefault() && !c().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !c().Ok()) return false; + } - if (!has_d().Known()) return false; - if (has_d().ValueOrDefault() && !d().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !d().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -6666,24 +6870,40 @@ class GenericDynamicFieldDependsOnLaterFieldView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -7198,28 +7418,47 @@ class GenericDynamicFieldDoesNotAffectSizeView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_c().Known()) return false; - if (has_c().ValueOrDefault() && !c().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !c().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/enum.emb.h b/testdata/golden_cpp/enum.emb.h index f056862..1d03fb6 100644 --- a/testdata/golden_cpp/enum.emb.h +++ b/testdata/golden_cpp/enum.emb.h @@ -139,24 +139,40 @@ class GenericConstantsView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_sprocket().Known()) return false; - if (has_sprocket().ValueOrDefault() && !sprocket().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !sprocket().Ok()) return false; + } - if (!has_geegaw().Known()) return false; - if (has_geegaw().ValueOrDefault() && !geegaw().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !geegaw().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -1546,20 +1562,33 @@ class GenericEmbossReservedAnonymousField1View final { bool Ok() const { if (!IsComplete()) return false; - if (!has_wide_kind_in_bits().Known()) return false; - if (has_wide_kind_in_bits().ValueOrDefault() && !wide_kind_in_bits().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !wide_kind_in_bits().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -1961,36 +1990,61 @@ class GenericManifestEntryView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_kind().Known()) return false; - if (has_kind().ValueOrDefault() && !kind().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !kind().Ok()) return false; + } - if (!has_count().Known()) return false; - if (has_count().ValueOrDefault() && !count().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !count().Ok()) return false; + } - if (!has_wide_kind().Known()) return false; - if (has_wide_kind().ValueOrDefault() && !wide_kind().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !wide_kind().Ok()) return false; + } - if (!has_emboss_reserved_anonymous_field_1().Known()) return false; - if (has_emboss_reserved_anonymous_field_1().ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; + } - if (!has_wide_kind_in_bits().Known()) return false; - if (has_wide_kind_in_bits().ValueOrDefault() && !wide_kind_in_bits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !wide_kind_in_bits().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -2720,20 +2774,33 @@ class GenericStructContainingEnumView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_bar().Known()) return false; - if (has_bar().ValueOrDefault() && !bar().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !bar().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/enum_case.emb.h b/testdata/golden_cpp/enum_case.emb.h index 5738596..4d6c432 100644 --- a/testdata/golden_cpp/enum_case.emb.h +++ b/testdata/golden_cpp/enum_case.emb.h @@ -334,28 +334,47 @@ class GenericUseKCamelEnumCaseView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_v().Known()) return false; - if (has_v().ValueOrDefault() && !v().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !v().Ok()) return false; + } - if (!has_first().Known()) return false; - if (has_first().ValueOrDefault() && !first().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !first().Ok()) return false; + } - if (!has_v_is_first().Known()) return false; - if (has_v_is_first().ValueOrDefault() && !v_is_first().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !v_is_first().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/explicit_sizes.emb.h b/testdata/golden_cpp/explicit_sizes.emb.h index f8fd46f..8005e47 100644 --- a/testdata/golden_cpp/explicit_sizes.emb.h +++ b/testdata/golden_cpp/explicit_sizes.emb.h @@ -118,28 +118,47 @@ class GenericSizedUIntArraysView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_one_nibble().Known()) return false; - if (has_one_nibble().ValueOrDefault() && !one_nibble().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !one_nibble().Ok()) return false; + } - if (!has_two_nibble().Known()) return false; - if (has_two_nibble().ValueOrDefault() && !two_nibble().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !two_nibble().Ok()) return false; + } - if (!has_four_nibble().Known()) return false; - if (has_four_nibble().ValueOrDefault() && !four_nibble().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !four_nibble().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -712,28 +731,47 @@ class GenericSizedIntArraysView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_one_nibble().Known()) return false; - if (has_one_nibble().ValueOrDefault() && !one_nibble().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !one_nibble().Ok()) return false; + } - if (!has_two_nibble().Known()) return false; - if (has_two_nibble().ValueOrDefault() && !two_nibble().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !two_nibble().Ok()) return false; + } - if (!has_four_nibble().Known()) return false; - if (has_four_nibble().ValueOrDefault() && !four_nibble().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !four_nibble().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -1306,28 +1344,47 @@ class GenericSizedEnumArraysView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_one_nibble().Known()) return false; - if (has_one_nibble().ValueOrDefault() && !one_nibble().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !one_nibble().Ok()) return false; + } - if (!has_two_nibble().Known()) return false; - if (has_two_nibble().ValueOrDefault() && !two_nibble().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !two_nibble().Ok()) return false; + } - if (!has_four_nibble().Known()) return false; - if (has_four_nibble().ValueOrDefault() && !four_nibble().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !four_nibble().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -1901,20 +1958,33 @@ class GenericBitArrayContainerView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_uint_arrays().Known()) return false; - if (has_uint_arrays().ValueOrDefault() && !uint_arrays().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !uint_arrays().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/float.emb.h b/testdata/golden_cpp/float.emb.h index d43d32e..c54aa66 100644 --- a/testdata/golden_cpp/float.emb.h +++ b/testdata/golden_cpp/float.emb.h @@ -99,24 +99,40 @@ class GenericFloatsView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_float_little_endian().Known()) return false; - if (has_float_little_endian().ValueOrDefault() && !float_little_endian().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !float_little_endian().Ok()) return false; + } - if (!has_float_big_endian().Known()) return false; - if (has_float_big_endian().ValueOrDefault() && !float_big_endian().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !float_big_endian().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -599,24 +615,40 @@ class GenericDoublesView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_double_little_endian().Known()) return false; - if (has_double_little_endian().ValueOrDefault() && !double_little_endian().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !double_little_endian().Ok()) return false; + } - if (!has_double_big_endian().Known()) return false; - if (has_double_big_endian().ValueOrDefault() && !double_big_endian().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !double_big_endian().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/imported.emb.h b/testdata/golden_cpp/imported.emb.h index 2217543..ce0cbea 100644 --- a/testdata/golden_cpp/imported.emb.h +++ b/testdata/golden_cpp/imported.emb.h @@ -90,20 +90,33 @@ class GenericInnerView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_value().Known()) return false; - if (has_value().ValueOrDefault() && !value().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !value().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/imported_genfiles.emb.h b/testdata/golden_cpp/imported_genfiles.emb.h index af1ef31..eb26bc9 100644 --- a/testdata/golden_cpp/imported_genfiles.emb.h +++ b/testdata/golden_cpp/imported_genfiles.emb.h @@ -91,20 +91,33 @@ class GenericInnerView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_value().Known()) return false; - if (has_value().ValueOrDefault() && !value().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !value().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/importer.emb.h b/testdata/golden_cpp/importer.emb.h index 75ad2d2..3c54911 100644 --- a/testdata/golden_cpp/importer.emb.h +++ b/testdata/golden_cpp/importer.emb.h @@ -95,24 +95,40 @@ class GenericOuterView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_inner().Known()) return false; - if (has_inner().ValueOrDefault() && !inner().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !inner().Ok()) return false; + } - if (!has_inner_gen().Known()) return false; - if (has_inner_gen().ValueOrDefault() && !inner_gen().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !inner_gen().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/importer2.emb.h b/testdata/golden_cpp/importer2.emb.h index ca22c93..8b99ad6 100644 --- a/testdata/golden_cpp/importer2.emb.h +++ b/testdata/golden_cpp/importer2.emb.h @@ -92,20 +92,33 @@ class GenericOuter2View final { bool Ok() const { if (!IsComplete()) return false; - if (!has_outer().Known()) return false; - if (has_outer().ValueOrDefault() && !outer().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !outer().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/inline_type.emb.h b/testdata/golden_cpp/inline_type.emb.h index 8f89827..0adbce3 100644 --- a/testdata/golden_cpp/inline_type.emb.h +++ b/testdata/golden_cpp/inline_type.emb.h @@ -272,24 +272,40 @@ class GenericFooView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_status().Known()) return false; - if (has_status().ValueOrDefault() && !status().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !status().Ok()) return false; + } - if (!has_secondary_status().Known()) return false; - if (has_secondary_status().ValueOrDefault() && !secondary_status().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !secondary_status().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/int_sizes.emb.h b/testdata/golden_cpp/int_sizes.emb.h index fe697e9..ddb7e4d 100644 --- a/testdata/golden_cpp/int_sizes.emb.h +++ b/testdata/golden_cpp/int_sizes.emb.h @@ -97,48 +97,82 @@ class GenericSizesView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; + } - if (!has_two_byte().Known()) return false; - if (has_two_byte().ValueOrDefault() && !two_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !two_byte().Ok()) return false; + } - if (!has_three_byte().Known()) return false; - if (has_three_byte().ValueOrDefault() && !three_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !three_byte().Ok()) return false; + } - if (!has_four_byte().Known()) return false; - if (has_four_byte().ValueOrDefault() && !four_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !four_byte().Ok()) return false; + } - if (!has_five_byte().Known()) return false; - if (has_five_byte().ValueOrDefault() && !five_byte().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !five_byte().Ok()) return false; + } - if (!has_six_byte().Known()) return false; - if (has_six_byte().ValueOrDefault() && !six_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !six_byte().Ok()) return false; + } - if (!has_seven_byte().Known()) return false; - if (has_seven_byte().ValueOrDefault() && !seven_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !seven_byte().Ok()) return false; + } - if (!has_eight_byte().Known()) return false; - if (has_eight_byte().ValueOrDefault() && !eight_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !eight_byte().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/large_array.emb.h b/testdata/golden_cpp/large_array.emb.h index 47b4511..81048d8 100644 --- a/testdata/golden_cpp/large_array.emb.h +++ b/testdata/golden_cpp/large_array.emb.h @@ -91,24 +91,40 @@ class GenericUIntArrayView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_element_count().Known()) return false; - if (has_element_count().ValueOrDefault() && !element_count().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !element_count().Ok()) return false; + } - if (!has_elements().Known()) return false; - if (has_elements().ValueOrDefault() && !elements().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !elements().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/nested_structure.emb.h b/testdata/golden_cpp/nested_structure.emb.h index b953e31..9da33ea 100644 --- a/testdata/golden_cpp/nested_structure.emb.h +++ b/testdata/golden_cpp/nested_structure.emb.h @@ -108,28 +108,47 @@ class GenericContainerView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_weight().Known()) return false; - if (has_weight().ValueOrDefault() && !weight().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !weight().Ok()) return false; + } - if (!has_important_box().Known()) return false; - if (has_important_box().ValueOrDefault() && !important_box().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !important_box().Ok()) return false; + } - if (!has_other_box().Known()) return false; - if (has_other_box().ValueOrDefault() && !other_box().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !other_box().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -685,24 +704,40 @@ class GenericBoxView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_id().Known()) return false; - if (has_id().ValueOrDefault() && !id().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !id().Ok()) return false; + } - if (!has_count().Known()) return false; - if (has_count().ValueOrDefault() && !count().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !count().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -1185,24 +1220,40 @@ class GenericTruckView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_id().Known()) return false; - if (has_id().ValueOrDefault() && !id().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !id().Ok()) return false; + } - if (!has_cargo().Known()) return false; - if (has_cargo().ValueOrDefault() && !cargo().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !cargo().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/next_keyword.emb.h b/testdata/golden_cpp/next_keyword.emb.h index 624c954..eb40049 100644 --- a/testdata/golden_cpp/next_keyword.emb.h +++ b/testdata/golden_cpp/next_keyword.emb.h @@ -93,32 +93,54 @@ class GenericNextKeywordView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_value32().Known()) return false; - if (has_value32().ValueOrDefault() && !value32().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !value32().Ok()) return false; + } - if (!has_value16().Known()) return false; - if (has_value16().ValueOrDefault() && !value16().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !value16().Ok()) return false; + } - if (!has_value8().Known()) return false; - if (has_value8().ValueOrDefault() && !value8().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !value8().Ok()) return false; + } - if (!has_value8_offset().Known()) return false; - if (has_value8_offset().ValueOrDefault() && !value8_offset().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !value8_offset().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/no_enum_traits.emb.h b/testdata/golden_cpp/no_enum_traits.emb.h index 5f97e05..c0aaafa 100644 --- a/testdata/golden_cpp/no_enum_traits.emb.h +++ b/testdata/golden_cpp/no_enum_traits.emb.h @@ -14,10 +14,6 @@ #include "runtime/cpp/emboss_prelude.h" -#include "runtime/cpp/emboss_enum_view.h" - -#include "runtime/cpp/emboss_text_util.h" - /* NOLINTBEGIN */ @@ -38,79 +34,6 @@ enum class Foo : ::std::uint64_t { VALUE = static_cast(10LL), }; -template -class EnumTraits; - -template <> -class EnumTraits final { - public: - static bool TryToGetEnumFromName(const char *emboss_reserved_local_name, - Foo *emboss_reserved_local_result) { - if (emboss_reserved_local_name == nullptr) return false; - if (!strcmp("VALUE", emboss_reserved_local_name)) { - *emboss_reserved_local_result = Foo::VALUE; - return true; - } - - return false; - } - - static const char *TryToGetNameFromEnum( - Foo emboss_reserved_local_value) { - switch (emboss_reserved_local_value) { - case Foo::VALUE: return "VALUE"; - - default: return nullptr; - } - } - - static bool EnumIsKnown(Foo emboss_reserved_local_value) { - switch (emboss_reserved_local_value) { - case Foo::VALUE: return true; - - default: - return false; - } - } - - static ::std::ostream &SendToOstream(::std::ostream &emboss_reserved_local_os, - Foo emboss_reserved_local_value) { - const char *emboss_reserved_local_name = - TryToGetNameFromEnum(emboss_reserved_local_value); - if (emboss_reserved_local_name == nullptr) { - emboss_reserved_local_os - << static_cast::type>( - emboss_reserved_local_value); - } else { - emboss_reserved_local_os << emboss_reserved_local_name; - } - return emboss_reserved_local_os; - } -}; - -static inline bool TryToGetEnumFromName( - const char *emboss_reserved_local_name, - Foo *emboss_reserved_local_result) { - return EnumTraits::TryToGetEnumFromName( - emboss_reserved_local_name, emboss_reserved_local_result); -} - -static inline const char *TryToGetNameFromEnum( - Foo emboss_reserved_local_value) { - return EnumTraits::TryToGetNameFromEnum( - emboss_reserved_local_value); -} - -static inline bool EnumIsKnown(Foo emboss_reserved_local_value) { - return EnumTraits::EnumIsKnown(emboss_reserved_local_value); -} - -static inline ::std::ostream &operator<<( - ::std::ostream &emboss_reserved_local_os, - Foo emboss_reserved_local_value) { - return EnumTraits::SendToOstream(emboss_reserved_local_os, - emboss_reserved_local_value); -} @@ -169,20 +92,33 @@ class GenericBarView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_foo().Known()) return false; - if (has_foo().ValueOrDefault() && !foo().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !foo().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -265,92 +201,6 @@ class GenericBarView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } - template - bool UpdateFromTextStream(Stream *emboss_reserved_local_stream) const { - ::std::string emboss_reserved_local_brace; - if (!::emboss::support::ReadToken(emboss_reserved_local_stream, - &emboss_reserved_local_brace)) - return false; - if (emboss_reserved_local_brace != "{") return false; - for (;;) { - ::std::string emboss_reserved_local_name; - if (!::emboss::support::ReadToken(emboss_reserved_local_stream, - &emboss_reserved_local_name)) - return false; - if (emboss_reserved_local_name == ",") - if (!::emboss::support::ReadToken(emboss_reserved_local_stream, - &emboss_reserved_local_name)) - return false; - if (emboss_reserved_local_name == "}") return true; - ::std::string emboss_reserved_local_colon; - if (!::emboss::support::ReadToken(emboss_reserved_local_stream, - &emboss_reserved_local_colon)) - return false; - if (emboss_reserved_local_colon != ":") return false; - if (emboss_reserved_local_name == "foo") { - if (!foo().UpdateFromTextStream( - emboss_reserved_local_stream)) { - return false; - } - continue; - } - - return false; - } - } - - template - void WriteToTextStream( - Stream *emboss_reserved_local_stream, - ::emboss::TextOutputOptions emboss_reserved_local_options) const { - ::emboss::TextOutputOptions emboss_reserved_local_field_options = - emboss_reserved_local_options.PlusOneIndent(); - if (emboss_reserved_local_options.multiline()) { - emboss_reserved_local_stream->Write("{\n"); - } else { - emboss_reserved_local_stream->Write("{"); - } - bool emboss_reserved_local_wrote_field = false; - if (has_foo().ValueOr(false)) { - if (!emboss_reserved_local_field_options.allow_partial_output() || - foo().IsAggregate() || foo().Ok()) { - if (emboss_reserved_local_field_options.multiline()) { - emboss_reserved_local_stream->Write( - emboss_reserved_local_field_options.current_indent()); - } else { - if (emboss_reserved_local_wrote_field) { - emboss_reserved_local_stream->Write(","); - } - emboss_reserved_local_stream->Write(" "); - } - emboss_reserved_local_stream->Write("foo: "); - foo().WriteToTextStream(emboss_reserved_local_stream, - emboss_reserved_local_field_options); - emboss_reserved_local_wrote_field = true; - if (emboss_reserved_local_field_options.multiline()) { - emboss_reserved_local_stream->Write("\n"); - } - } else if (emboss_reserved_local_field_options.allow_partial_output() && - emboss_reserved_local_field_options.comments() && - !foo().IsAggregate() && !foo().Ok()) { - if (emboss_reserved_local_field_options.multiline()) { - emboss_reserved_local_stream->Write( - emboss_reserved_local_field_options.current_indent()); - } - emboss_reserved_local_stream->Write("# foo: UNREADABLE\n"); - } - } - - (void)emboss_reserved_local_wrote_field; - if (emboss_reserved_local_options.multiline()) { - emboss_reserved_local_stream->Write( - emboss_reserved_local_options.current_indent()); - emboss_reserved_local_stream->Write("}"); - } else { - emboss_reserved_local_stream->Write(" }"); - } - } - static constexpr bool IsAggregate() { return true; } diff --git a/testdata/golden_cpp/parameters.emb.h b/testdata/golden_cpp/parameters.emb.h index d60f164..b6c33ae 100644 --- a/testdata/golden_cpp/parameters.emb.h +++ b/testdata/golden_cpp/parameters.emb.h @@ -388,32 +388,55 @@ class GenericMultiVersionView final { bool Ok() const { if (!IsComplete()) return false; if (!parameters_initialized_) return false; - if (!has_message_id().Known()) return false; - if (has_message_id().ValueOrDefault() && !message_id().Ok()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = message_id(); + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !message_id().Ok()) return false; + } - if (!has_axes().Known()) return false; - if (has_axes().ValueOrDefault() && !axes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !axes().Ok()) return false; + } - if (!has_config().Known()) return false; - if (has_config().ValueOrDefault() && !config().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(1))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !config().Ok()) return false; + } - if (!has_config_vx().Known()) return false; - if (has_config_vx().ValueOrDefault() && !config_vx().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::Equal((product().Ok() ? ::emboss::support::Maybe(static_cast(product().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(23))), ::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(1)))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !config_vx().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -1129,36 +1152,62 @@ class GenericAxesView final { bool Ok() const { if (!IsComplete()) return false; if (!parameters_initialized_) return false; - if (!has_values().Known()) return false; - if (has_values().ValueOrDefault() && !values().Ok()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = axes(); + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !values().Ok()) return false; + } - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThan((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThan((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(1LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; + } - if (!has_z().Known()) return false; - if (has_z().ValueOrDefault() && !z().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThan((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(2LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !z().Ok()) return false; + } - if (!has_axis_count_plus_one().Known()) return false; - if (has_axis_count_plus_one().ValueOrDefault() && !axis_count_plus_one().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !axis_count_plus_one().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -1961,32 +2010,54 @@ class GenericAxisPairView final { bool Ok() const { if (!IsComplete()) return false; if (!parameters_initialized_) return false; - if (!has_axis_type_a().Known()) return false; - if (has_axis_type_a().ValueOrDefault() && !axis_type_a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !axis_type_a().Ok()) return false; + } - if (!has_axis_a().Known()) return false; - if (has_axis_a().ValueOrDefault() && !axis_a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !axis_a().Ok()) return false; + } - if (!has_axis_type_b().Known()) return false; - if (has_axis_type_b().ValueOrDefault() && !axis_type_b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !axis_type_b().Ok()) return false; + } - if (!has_axis_b().Known()) return false; - if (has_axis_b().ValueOrDefault() && !axis_b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !axis_b().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -2716,24 +2787,40 @@ class GenericAxesEnvelopeView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_axis_count().Known()) return false; - if (has_axis_count().ValueOrDefault() && !axis_count().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !axis_count().Ok()) return false; + } - if (!has_axes().Known()) return false; - if (has_axes().ValueOrDefault() && !axes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !axes().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -3356,36 +3443,62 @@ class GenericAxisView final { bool Ok() const { if (!IsComplete()) return false; if (!parameters_initialized_) return false; - if (!has_value().Known()) return false; - if (has_value().ValueOrDefault() && !value().Ok()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = axis_type(); + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !value().Ok()) return false; + } - if (!has_axis_type().Known()) return false; - if (has_axis_type().ValueOrDefault() && !axis_type().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !axis_type().Ok()) return false; + } - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(1))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(2))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; + } - if (!has_z().Known()) return false; - if (has_z().ValueOrDefault() && !z().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(3))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !z().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -4146,20 +4259,33 @@ class GenericConfigView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_power().Known()) return false; - if (has_power().ValueOrDefault() && !power().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !power().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -4570,20 +4696,33 @@ class GenericEmbossReservedAnonymousField1View final { bool Ok() const { if (!IsComplete()) return false; - if (!has_power().Known()) return false; - if (has_power().ValueOrDefault() && !power().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !power().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -4984,28 +5123,47 @@ class GenericConfigVXView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_emboss_reserved_anonymous_field_1().Known()) return false; - if (has_emboss_reserved_anonymous_field_1().ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; + } - if (!has_power().Known()) return false; - if (has_power().ValueOrDefault() && !power().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !power().Ok()) return false; + } - if (!has_gain().Known()) return false; - if (has_gain().ValueOrDefault() && !gain().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !gain().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -5493,20 +5651,33 @@ class GenericStructWithUnusedParameterView final { bool Ok() const { if (!IsComplete()) return false; if (!parameters_initialized_) return false; - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -5955,24 +6126,40 @@ class GenericStructContainingStructWithUnusedParameterView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_swup().Known()) return false; - if (has_swup().ValueOrDefault() && !swup().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !swup().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -6454,24 +6641,40 @@ class GenericBiasedValueView final { bool Ok() const { if (!IsComplete()) return false; if (!parameters_initialized_) return false; - if (!has_raw_value().Known()) return false; - if (has_raw_value().ValueOrDefault() && !raw_value().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !raw_value().Ok()) return false; + } - if (!has_value().Known()) return false; - if (has_value().ValueOrDefault() && !value().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !value().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -7006,24 +7209,40 @@ class GenericVirtualFirstFieldWithParamView final { bool Ok() const { if (!IsComplete()) return false; if (!parameters_initialized_) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_value().Known()) return false; - if (has_value().ValueOrDefault() && !value().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !value().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -7518,24 +7737,40 @@ class GenericConstVirtualFirstFieldWithParamView final { bool Ok() const { if (!IsComplete()) return false; if (!parameters_initialized_) return false; - if (!has_value().Known()) return false; - if (has_value().ValueOrDefault() && !value().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !value().Ok()) return false; + } - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -8039,28 +8274,47 @@ class GenericSizedArrayOfBiasedValuesView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_element_count().Known()) return false; - if (has_element_count().ValueOrDefault() && !element_count().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !element_count().Ok()) return false; + } - if (!has_bias().Known()) return false; - if (has_bias().ValueOrDefault() && !bias().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !bias().Ok()) return false; + } - if (!has_values().Known()) return false; - if (has_values().ValueOrDefault() && !values().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !values().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/requires.emb.h b/testdata/golden_cpp/requires.emb.h index 500813b..1d2c250 100644 --- a/testdata/golden_cpp/requires.emb.h +++ b/testdata/golden_cpp/requires.emb.h @@ -192,40 +192,68 @@ class GenericRequiresIntegersView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_zero_through_nine().Known()) return false; - if (has_zero_through_nine().ValueOrDefault() && !zero_through_nine().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !zero_through_nine().Ok()) return false; + } - if (!has_ten_through_twenty().Known()) return false; - if (has_ten_through_twenty().ValueOrDefault() && !ten_through_twenty().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !ten_through_twenty().Ok()) return false; + } - if (!has_disjoint().Known()) return false; - if (has_disjoint().ValueOrDefault() && !disjoint().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !disjoint().Ok()) return false; + } - if (!has_ztn_plus_ttt().Known()) return false; - if (has_ztn_plus_ttt().ValueOrDefault() && !ztn_plus_ttt().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !ztn_plus_ttt().Ok()) return false; + } - if (!has_alias_of_zero_through_nine().Known()) return false; - if (has_alias_of_zero_through_nine().ValueOrDefault() && !alias_of_zero_through_nine().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !alias_of_zero_through_nine().Ok()) return false; + } - if (!has_zero_through_nine_plus_five().Known()) return false; - if (has_zero_through_nine_plus_five().ValueOrDefault() && !zero_through_nine_plus_five().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !zero_through_nine_plus_five().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } if (!(::emboss::support::LessThanOrEqual((zero_through_nine().Ok() ? ::emboss::support::Maybe(static_cast(zero_through_nine().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Difference((ten_through_twenty().Ok() ? ::emboss::support::Maybe(static_cast(ten_through_twenty().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(10LL))))).ValueOr(false)) @@ -1166,32 +1194,54 @@ class GenericEmbossReservedAnonymousField2View final { bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_must_be_true().Known()) return false; - if (has_must_be_true().ValueOrDefault() && !must_be_true().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !must_be_true().Ok()) return false; + } - if (!has_must_be_false().Known()) return false; - if (has_must_be_false().ValueOrDefault() && !must_be_false().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !must_be_false().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -1823,44 +1873,76 @@ class GenericRequiresBoolsView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_emboss_reserved_anonymous_field_2().Known()) return false; - if (has_emboss_reserved_anonymous_field_2().ValueOrDefault() && !emboss_reserved_anonymous_field_2().Ok()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_2().Ok()) return false; + } - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_must_be_true().Known()) return false; - if (has_must_be_true().ValueOrDefault() && !must_be_true().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !must_be_true().Ok()) return false; + } - if (!has_must_be_false().Known()) return false; - if (has_must_be_false().ValueOrDefault() && !must_be_false().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !must_be_false().Ok()) return false; + } - if (!has_b_must_be_false().Known()) return false; - if (has_b_must_be_false().ValueOrDefault() && !b_must_be_false().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b_must_be_false().Ok()) return false; + } - if (!has_alias_of_a_must_be_true().Known()) return false; - if (has_alias_of_a_must_be_true().ValueOrDefault() && !alias_of_a_must_be_true().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !alias_of_a_must_be_true().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } if (!(::emboss::support::Or((a().Ok() ? ::emboss::support::Maybe(static_cast(a().UncheckedRead())) : ::emboss::support::Maybe()), (b().Ok() ? ::emboss::support::Maybe(static_cast(b().UncheckedRead())) : ::emboss::support::Maybe()))).ValueOr(false)) @@ -2741,36 +2823,61 @@ class GenericRequiresEnumsView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_c().Known()) return false; - if (has_c().ValueOrDefault() && !c().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !c().Ok()) return false; + } - if (!has_filtered_a().Known()) return false; - if (has_filtered_a().ValueOrDefault() && !filtered_a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !filtered_a().Ok()) return false; + } - if (!has_alias_of_a().Known()) return false; - if (has_alias_of_a().ValueOrDefault() && !alias_of_a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !alias_of_a().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } if (!(::emboss::support::Or(::emboss::support::Equal((a().Ok() ? ::emboss::support::Maybe(static_cast(a().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0))), ::emboss::support::Equal((b().Ok() ? ::emboss::support::Maybe(static_cast(b().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0))))).ValueOr(false)) @@ -3569,32 +3676,55 @@ class GenericEmbossReservedAnonymousField1View final { bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = b_exists(); + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_b_exists().Known()) return false; - if (has_b_exists().ValueOrDefault() && !b_exists().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b_exists().Ok()) return false; + } - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_b_true().Known()) return false; - if (has_b_true().ValueOrDefault() && !b_true().Ok()) return false; + { + const auto emboss_reserved_local_field_present = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b_true().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -4255,36 +4385,62 @@ class GenericRequiresWithOptionalFieldsView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_emboss_reserved_anonymous_field_1().Known()) return false; - if (has_emboss_reserved_anonymous_field_1().ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; + } - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_b_exists().Known()) return false; - if (has_b_exists().ValueOrDefault() && !b_exists().Ok()) return false; + { + const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b_exists().Ok()) return false; + } - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::Maybe(true), emboss_reserved_anonymous_field_1().has_b()); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_b_true().Known()) return false; - if (has_b_true().ValueOrDefault() && !b_true().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::Maybe(true), emboss_reserved_anonymous_field_1().has_b_true()); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b_true().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } if (!(::emboss::support::Or((a().Ok() ? ::emboss::support::Maybe(static_cast(a().UncheckedRead())) : ::emboss::support::Maybe()), (b().Ok() ? ::emboss::support::Maybe(static_cast(b().UncheckedRead())) : ::emboss::support::Maybe()))).ValueOr(false)) @@ -4847,20 +5003,33 @@ class GenericElementView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -5261,20 +5430,33 @@ class GenericRequiresInArrayElementsView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_xs().Known()) return false; - if (has_xs().ValueOrDefault() && !xs().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xs().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/start_size_range.emb.h b/testdata/golden_cpp/start_size_range.emb.h index d9f0166..f4f3c71 100644 --- a/testdata/golden_cpp/start_size_range.emb.h +++ b/testdata/golden_cpp/start_size_range.emb.h @@ -93,32 +93,54 @@ class GenericStartSizeView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_size().Known()) return false; - if (has_size().ValueOrDefault() && !size().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !size().Ok()) return false; + } - if (!has_start_size_constants().Known()) return false; - if (has_start_size_constants().ValueOrDefault() && !start_size_constants().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !start_size_constants().Ok()) return false; + } - if (!has_payload().Known()) return false; - if (has_payload().ValueOrDefault() && !payload().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !payload().Ok()) return false; + } - if (!has_counter().Known()) return false; - if (has_counter().ValueOrDefault() && !counter().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !counter().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/subtypes.emb.h b/testdata/golden_cpp/subtypes.emb.h index 860d554..5177de1 100644 --- a/testdata/golden_cpp/subtypes.emb.h +++ b/testdata/golden_cpp/subtypes.emb.h @@ -226,28 +226,47 @@ class GenericInInView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_outer_offset().Known()) return false; - if (has_outer_offset().ValueOrDefault() && !outer_offset().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !outer_offset().Ok()) return false; + } - if (!has_field_enum().Known()) return false; - if (has_field_enum().ValueOrDefault() && !field_enum().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !field_enum().Ok()) return false; + } - if (!has_in_2().Known()) return false; - if (has_in_2().ValueOrDefault() && !in_2().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !in_2().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -778,40 +797,68 @@ class GenericInView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_in_in_1().Known()) return false; - if (has_in_in_1().ValueOrDefault() && !in_in_1().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !in_in_1().Ok()) return false; + } - if (!has_in_in_2().Known()) return false; - if (has_in_in_2().ValueOrDefault() && !in_in_2().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !in_in_2().Ok()) return false; + } - if (!has_in_in_in_1().Known()) return false; - if (has_in_in_in_1().ValueOrDefault() && !in_in_in_1().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !in_in_in_1().Ok()) return false; + } - if (!has_in_2().Known()) return false; - if (has_in_2().ValueOrDefault() && !in_2().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !in_2().Ok()) return false; + } - if (!has_name_collision().Known()) return false; - if (has_name_collision().ValueOrDefault() && !name_collision().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !name_collision().Ok()) return false; + } - if (!has_name_collision_check().Known()) return false; - if (has_name_collision_check().ValueOrDefault() && !name_collision_check().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !name_collision_check().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -1627,20 +1674,33 @@ class GenericIn2View final { bool Ok() const { if (!IsComplete()) return false; - if (!has_field_byte().Known()) return false; - if (has_field_byte().ValueOrDefault() && !field_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !field_byte().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -2041,48 +2101,82 @@ class GenericOutView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_in_1().Known()) return false; - if (has_in_1().ValueOrDefault() && !in_1().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !in_1().Ok()) return false; + } - if (!has_in_2().Known()) return false; - if (has_in_2().ValueOrDefault() && !in_2().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !in_2().Ok()) return false; + } - if (!has_in_in_1().Known()) return false; - if (has_in_in_1().ValueOrDefault() && !in_in_1().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !in_in_1().Ok()) return false; + } - if (!has_in_in_2().Known()) return false; - if (has_in_in_2().ValueOrDefault() && !in_in_2().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !in_in_2().Ok()) return false; + } - if (!has_in_in_in_1().Known()) return false; - if (has_in_in_in_1().ValueOrDefault() && !in_in_in_1().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !in_in_in_1().Ok()) return false; + } - if (!has_in_in_in_2().Known()) return false; - if (has_in_in_in_2().ValueOrDefault() && !in_in_in_2().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !in_in_in_2().Ok()) return false; + } - if (!has_name_collision().Known()) return false; - if (has_name_collision().ValueOrDefault() && !name_collision().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !name_collision().Ok()) return false; + } - if (!has_nested_constant_check().Known()) return false; - if (has_nested_constant_check().ValueOrDefault() && !nested_constant_check().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !nested_constant_check().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/text_format.emb.h b/testdata/golden_cpp/text_format.emb.h index 46f257d..5103a11 100644 --- a/testdata/golden_cpp/text_format.emb.h +++ b/testdata/golden_cpp/text_format.emb.h @@ -107,24 +107,40 @@ class GenericVanillaView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -608,28 +624,47 @@ class GenericStructWithSkippedFieldsView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_c().Known()) return false; - if (has_c().ValueOrDefault() && !c().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !c().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -1160,28 +1195,47 @@ class GenericStructWithSkippedStructureFieldsView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_c().Known()) return false; - if (has_c().ValueOrDefault() && !c().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !c().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/uint_sizes.emb.h b/testdata/golden_cpp/uint_sizes.emb.h index df5eb3f..60c8780 100644 --- a/testdata/golden_cpp/uint_sizes.emb.h +++ b/testdata/golden_cpp/uint_sizes.emb.h @@ -149,48 +149,82 @@ class GenericSizesView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; + } - if (!has_two_byte().Known()) return false; - if (has_two_byte().ValueOrDefault() && !two_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !two_byte().Ok()) return false; + } - if (!has_three_byte().Known()) return false; - if (has_three_byte().ValueOrDefault() && !three_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !three_byte().Ok()) return false; + } - if (!has_four_byte().Known()) return false; - if (has_four_byte().ValueOrDefault() && !four_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !four_byte().Ok()) return false; + } - if (!has_five_byte().Known()) return false; - if (has_five_byte().ValueOrDefault() && !five_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !five_byte().Ok()) return false; + } - if (!has_six_byte().Known()) return false; - if (has_six_byte().ValueOrDefault() && !six_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !six_byte().Ok()) return false; + } - if (!has_seven_byte().Known()) return false; - if (has_seven_byte().ValueOrDefault() && !seven_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !seven_byte().Ok()) return false; + } - if (!has_eight_byte().Known()) return false; - if (has_eight_byte().ValueOrDefault() && !eight_byte().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !eight_byte().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -1141,48 +1175,82 @@ class GenericBigEndianSizesView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; + } - if (!has_two_byte().Known()) return false; - if (has_two_byte().ValueOrDefault() && !two_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !two_byte().Ok()) return false; + } - if (!has_three_byte().Known()) return false; - if (has_three_byte().ValueOrDefault() && !three_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !three_byte().Ok()) return false; + } - if (!has_four_byte().Known()) return false; - if (has_four_byte().ValueOrDefault() && !four_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !four_byte().Ok()) return false; + } - if (!has_five_byte().Known()) return false; - if (has_five_byte().ValueOrDefault() && !five_byte().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !five_byte().Ok()) return false; + } - if (!has_six_byte().Known()) return false; - if (has_six_byte().ValueOrDefault() && !six_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !six_byte().Ok()) return false; + } - if (!has_seven_byte().Known()) return false; - if (has_seven_byte().ValueOrDefault() && !seven_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !seven_byte().Ok()) return false; + } - if (!has_eight_byte().Known()) return false; - if (has_eight_byte().ValueOrDefault() && !eight_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !eight_byte().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -2133,48 +2201,82 @@ class GenericAlternatingEndianSizesView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; + } - if (!has_two_byte().Known()) return false; - if (has_two_byte().ValueOrDefault() && !two_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !two_byte().Ok()) return false; + } - if (!has_three_byte().Known()) return false; - if (has_three_byte().ValueOrDefault() && !three_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !three_byte().Ok()) return false; + } - if (!has_four_byte().Known()) return false; - if (has_four_byte().ValueOrDefault() && !four_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !four_byte().Ok()) return false; + } - if (!has_five_byte().Known()) return false; - if (has_five_byte().ValueOrDefault() && !five_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !five_byte().Ok()) return false; + } - if (!has_six_byte().Known()) return false; - if (has_six_byte().ValueOrDefault() && !six_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !six_byte().Ok()) return false; + } - if (!has_seven_byte().Known()) return false; - if (has_seven_byte().ValueOrDefault() && !seven_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !seven_byte().Ok()) return false; + } - if (!has_eight_byte().Known()) return false; - if (has_eight_byte().ValueOrDefault() && !eight_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !eight_byte().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -3125,48 +3227,82 @@ class GenericEnumSizesView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; + } - if (!has_two_byte().Known()) return false; - if (has_two_byte().ValueOrDefault() && !two_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !two_byte().Ok()) return false; + } - if (!has_three_byte().Known()) return false; - if (has_three_byte().ValueOrDefault() && !three_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !three_byte().Ok()) return false; + } - if (!has_four_byte().Known()) return false; - if (has_four_byte().ValueOrDefault() && !four_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !four_byte().Ok()) return false; + } - if (!has_five_byte().Known()) return false; - if (has_five_byte().ValueOrDefault() && !five_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !five_byte().Ok()) return false; + } - if (!has_six_byte().Known()) return false; - if (has_six_byte().ValueOrDefault() && !six_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !six_byte().Ok()) return false; + } - if (!has_seven_byte().Known()) return false; - if (has_seven_byte().ValueOrDefault() && !seven_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !seven_byte().Ok()) return false; + } - if (!has_eight_byte().Known()) return false; - if (has_eight_byte().ValueOrDefault() && !eight_byte().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !eight_byte().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -4126,20 +4262,33 @@ class GenericEmbossReservedAnonymousField1View final { bool Ok() const { if (!IsComplete()) return false; - if (!has_three_and_a_half_byte().Known()) return false; - if (has_three_and_a_half_byte().ValueOrDefault() && !three_and_a_half_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !three_and_a_half_byte().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -4541,36 +4690,61 @@ class GenericExplicitlySizedEnumSizesView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; + } - if (!has_two_byte().Known()) return false; - if (has_two_byte().ValueOrDefault() && !two_byte().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !two_byte().Ok()) return false; + } - if (!has_three_byte().Known()) return false; - if (has_three_byte().ValueOrDefault() && !three_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !three_byte().Ok()) return false; + } - if (!has_emboss_reserved_anonymous_field_1().Known()) return false; - if (has_emboss_reserved_anonymous_field_1().ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; + } - if (!has_three_and_a_half_byte().Known()) return false; - if (has_three_and_a_half_byte().ValueOrDefault() && !three_and_a_half_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !three_and_a_half_byte().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -5515,48 +5689,82 @@ class GenericArraySizesView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; + } - if (!has_two_byte().Known()) return false; - if (has_two_byte().ValueOrDefault() && !two_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !two_byte().Ok()) return false; + } - if (!has_three_byte().Known()) return false; - if (has_three_byte().ValueOrDefault() && !three_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !three_byte().Ok()) return false; + } - if (!has_four_byte().Known()) return false; - if (has_four_byte().ValueOrDefault() && !four_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !four_byte().Ok()) return false; + } - if (!has_five_byte().Known()) return false; - if (has_five_byte().ValueOrDefault() && !five_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !five_byte().Ok()) return false; + } - if (!has_six_byte().Known()) return false; - if (has_six_byte().ValueOrDefault() && !six_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !six_byte().Ok()) return false; + } - if (!has_seven_byte().Known()) return false; - if (has_seven_byte().ValueOrDefault() && !seven_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !seven_byte().Ok()) return false; + } - if (!has_eight_byte().Known()) return false; - if (has_eight_byte().ValueOrDefault() && !eight_byte().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !eight_byte().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/golden_cpp/virtual_field.emb.h b/testdata/golden_cpp/virtual_field.emb.h index 140020a..d2544ed 100644 --- a/testdata/golden_cpp/virtual_field.emb.h +++ b/testdata/golden_cpp/virtual_field.emb.h @@ -253,56 +253,96 @@ class GenericStructureWithConstantsView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_ten().Known()) return false; - if (has_ten().ValueOrDefault() && !ten().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !ten().Ok()) return false; + } - if (!has_twenty().Known()) return false; - if (has_twenty().ValueOrDefault() && !twenty().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !twenty().Ok()) return false; + } - if (!has_four_billion().Known()) return false; - if (has_four_billion().ValueOrDefault() && !four_billion().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !four_billion().Ok()) return false; + } - if (!has_ten_billion().Known()) return false; - if (has_ten_billion().ValueOrDefault() && !ten_billion().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !ten_billion().Ok()) return false; + } - if (!has_minus_ten_billion().Known()) return false; - if (has_minus_ten_billion().ValueOrDefault() && !minus_ten_billion().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !minus_ten_billion().Ok()) return false; + } - if (!has_value().Known()) return false; - if (has_value().ValueOrDefault() && !value().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !value().Ok()) return false; + } - if (!has_alias_of_value().Known()) return false; - if (has_alias_of_value().ValueOrDefault() && !alias_of_value().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !alias_of_value().Ok()) return false; + } - if (!has_alias_of_alias_of_value().Known()) return false; - if (has_alias_of_alias_of_value().ValueOrDefault() && !alias_of_alias_of_value().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !alias_of_alias_of_value().Ok()) return false; + } - if (!has_alias_of_ten().Known()) return false; - if (has_alias_of_ten().ValueOrDefault() && !alias_of_ten().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !alias_of_ten().Ok()) return false; + } - if (!has_alias_of_alias_of_ten().Known()) return false; - if (has_alias_of_alias_of_ten().ValueOrDefault() && !alias_of_alias_of_ten().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !alias_of_alias_of_ten().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -1181,44 +1221,75 @@ class GenericStructureWithComputedValuesView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_value().Known()) return false; - if (has_value().ValueOrDefault() && !value().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !value().Ok()) return false; + } - if (!has_doubled().Known()) return false; - if (has_doubled().ValueOrDefault() && !doubled().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !doubled().Ok()) return false; + } - if (!has_plus_ten().Known()) return false; - if (has_plus_ten().ValueOrDefault() && !plus_ten().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !plus_ten().Ok()) return false; + } - if (!has_value2().Known()) return false; - if (has_value2().ValueOrDefault() && !value2().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !value2().Ok()) return false; + } - if (!has_signed_doubled().Known()) return false; - if (has_signed_doubled().ValueOrDefault() && !signed_doubled().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !signed_doubled().Ok()) return false; + } - if (!has_signed_plus_ten().Known()) return false; - if (has_signed_plus_ten().ValueOrDefault() && !signed_plus_ten().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !signed_plus_ten().Ok()) return false; + } - if (!has_product().Known()) return false; - if (has_product().ValueOrDefault() && !product().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !product().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -2211,28 +2282,47 @@ class GenericStructureWithConditionalValueView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_two_x().Known()) return false; - if (has_two_x().ValueOrDefault() && !two_x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::LessThan((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(2147483648ULL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !two_x().Ok()) return false; + } - if (!has_x_plus_one().Known()) return false; - if (has_x_plus_one().ValueOrDefault() && !x_plus_one().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x_plus_one().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -2851,28 +2941,47 @@ class GenericStructureWithValueInConditionView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_two_x().Known()) return false; - if (has_two_x().ValueOrDefault() && !two_x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !two_x().Ok()) return false; + } - if (!has_if_two_x_lt_100().Known()) return false; - if (has_if_two_x_lt_100().ValueOrDefault() && !if_two_x_lt_100().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::LessThan((two_x().Ok() ? ::emboss::support::Maybe(static_cast(two_x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(100LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !if_two_x_lt_100().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -3470,32 +3579,54 @@ class GenericStructureWithValuesInLocationView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_two_x().Known()) return false; - if (has_two_x().ValueOrDefault() && !two_x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !two_x().Ok()) return false; + } - if (!has_offset_two_x().Known()) return false; - if (has_offset_two_x().ValueOrDefault() && !offset_two_x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !offset_two_x().Ok()) return false; + } - if (!has_size_two_x().Known()) return false; - if (has_size_two_x().ValueOrDefault() && !size_two_x().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !size_two_x().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -4170,24 +4301,40 @@ class GenericStructureWithBoolValueView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_x_is_ten().Known()) return false; - if (has_x_is_ten().ValueOrDefault() && !x_is_ten().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x_is_ten().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -4763,24 +4910,40 @@ class GenericStructureWithEnumValueView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_x_size().Known()) return false; - if (has_x_size().ValueOrDefault() && !x_size().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x_size().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -5271,28 +5434,47 @@ class GenericStructureWithBitsWithValueView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_alias_of_b_sum().Known()) return false; - if (has_alias_of_b_sum().ValueOrDefault() && !alias_of_b_sum().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !alias_of_b_sum().Ok()) return false; + } - if (!has_alias_of_b_a().Known()) return false; - if (has_alias_of_b_a().ValueOrDefault() && !alias_of_b_a().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !alias_of_b_a().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -5824,28 +6006,47 @@ class GenericBitsWithValueView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; + } - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; + } - if (!has_sum().Known()) return false; - if (has_sum().ValueOrDefault() && !sum().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !sum().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -6413,24 +6614,40 @@ class GenericStructureUsingForeignConstantsView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_one_hundred().Known()) return false; - if (has_one_hundred().ValueOrDefault() && !one_hundred().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !one_hundred().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -6896,24 +7113,40 @@ class GenericHeaderView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_size().Known()) return false; - if (has_size().ValueOrDefault() && !size().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !size().Ok()) return false; + } - if (!has_message_id().Known()) return false; - if (has_message_id().ValueOrDefault() && !message_id().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !message_id().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -7391,28 +7624,47 @@ class GenericSubfieldOfAliasView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_header().Known()) return false; - if (has_header().ValueOrDefault() && !header().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !header().Ok()) return false; + } - if (!has_h().Known()) return false; - if (has_h().ValueOrDefault() && !h().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !h().Ok()) return false; + } - if (!has_size().Known()) return false; - if (has_size().ValueOrDefault() && !size().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !size().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -7907,28 +8159,47 @@ class GenericRestrictedAliasView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_a_b().Known()) return false; - if (has_a_b().ValueOrDefault() && !a_b().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a_b().Ok()) return false; + } - if (!has_alias_switch().Known()) return false; - if (has_alias_switch().ValueOrDefault() && !alias_switch().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !alias_switch().Ok()) return false; + } - if (!has_a_b_alias().Known()) return false; - if (has_a_b_alias().ValueOrDefault() && !a_b_alias().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThan((alias_switch().Ok() ? ::emboss::support::Maybe(static_cast(alias_switch().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(10LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !a_b_alias().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -8461,24 +8732,40 @@ class GenericXView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_v().Known()) return false; - if (has_v().ValueOrDefault() && !v().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !v().Ok()) return false; + } - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThan((v().Ok() ? ::emboss::support::Maybe(static_cast(v().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(10LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -8986,32 +9273,54 @@ class GenericHasFieldView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_z().Known()) return false; - if (has_z().ValueOrDefault() && !z().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !z().Ok()) return false; + } - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThan((z().Ok() ? ::emboss::support::Maybe(static_cast(z().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(10LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; + { + const auto emboss_reserved_local_field_present = x().has_y(); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; + } - if (!has_x_has_y().Known()) return false; - if (has_x_has_y().ValueOrDefault() && !x_has_y().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = has_x(); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x_has_y().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -9649,28 +9958,47 @@ class GenericVirtualUnconditionallyUsesConditionalView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Equal((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + } - if (!has_x_nor_xc().Known()) return false; - if (has_x_nor_xc().ValueOrDefault() && !x_nor_xc().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x_nor_xc().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -10275,24 +10603,40 @@ class GenericRView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_q().Known()) return false; - if (has_q().ValueOrDefault() && !q().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !q().Ok()) return false; + } - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; + } - if (!has_q_plus_bit_size().Known()) return false; - if (has_q_plus_bit_size().ValueOrDefault() && !q_plus_bit_size().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !q_plus_bit_size().Ok()) return false; + } - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + } - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + } @@ -10776,24 +11120,40 @@ class GenericUsesSizeView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_r().Known()) return false; - if (has_r().ValueOrDefault() && !r().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !r().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_r_q_plus_byte_size().Known()) return false; - if (has_r_q_plus_byte_size().ValueOrDefault() && !r_q_plus_byte_size().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !r_q_plus_byte_size().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -11280,24 +11640,40 @@ class GenericUsesExternalSizeView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } @@ -11780,40 +12156,68 @@ class GenericImplicitWriteBackView final { bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; + } - if (!has_x_plus_ten().Known()) return false; - if (has_x_plus_ten().ValueOrDefault() && !x_plus_ten().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x_plus_ten().Ok()) return false; + } - if (!has_ten_plus_x().Known()) return false; - if (has_ten_plus_x().ValueOrDefault() && !ten_plus_x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !ten_plus_x().Ok()) return false; + } - if (!has_x_minus_ten().Known()) return false; - if (has_x_minus_ten().ValueOrDefault() && !x_minus_ten().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !x_minus_ten().Ok()) return false; + } - if (!has_ten_minus_x().Known()) return false; - if (has_ten_minus_x().ValueOrDefault() && !ten_minus_x().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !ten_minus_x().Ok()) return false; + } - if (!has_ten_minus_x_plus_ten().Known()) return false; - if (has_ten_minus_x_plus_ten().ValueOrDefault() && !ten_minus_x_plus_ten().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !ten_minus_x_plus_ten().Ok()) return false; + } - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + } - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + } - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + + { + const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); + if (!emboss_reserved_local_field_present.Known()) return false; + if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + } diff --git a/testdata/many_conditionals.emb b/testdata/many_conditionals.emb new file mode 100644 index 0000000..6efa7c6 --- /dev/null +++ b/testdata/many_conditionals.emb @@ -0,0 +1,305 @@ +[(cpp) namespace: "emboss::test"] +[$default byte_order: "LittleEndian"] + + +struct LargeConditionals: + 0 [+4] UInt tag + if tag == 0: + 4 [+4] UInt f0 + + if tag == 1: + 4 [+4] UInt f1 + + if tag == 2: + 4 [+4] UInt f2 + + if tag == 3: + 4 [+4] UInt f3 + + if tag == 4: + 4 [+4] UInt f4 + + if tag == 5: + 4 [+4] UInt f5 + + if tag == 6: + 4 [+4] UInt f6 + + if tag == 7: + 4 [+4] UInt f7 + + if tag == 8: + 4 [+4] UInt f8 + + if tag == 9: + 4 [+4] UInt f9 + + if tag == 10: + 4 [+4] UInt f10 + + if tag == 11: + 4 [+4] UInt f11 + + if tag == 12: + 4 [+4] UInt f12 + + if tag == 13: + 4 [+4] UInt f13 + + if tag == 14: + 4 [+4] UInt f14 + + if tag == 15: + 4 [+4] UInt f15 + + if tag == 16: + 4 [+4] UInt f16 + + if tag == 17: + 4 [+4] UInt f17 + + if tag == 18: + 4 [+4] UInt f18 + + if tag == 19: + 4 [+4] UInt f19 + + if tag == 20: + 4 [+4] UInt f20 + + if tag == 21: + 4 [+4] UInt f21 + + if tag == 22: + 4 [+4] UInt f22 + + if tag == 23: + 4 [+4] UInt f23 + + if tag == 24: + 4 [+4] UInt f24 + + if tag == 25: + 4 [+4] UInt f25 + + if tag == 26: + 4 [+4] UInt f26 + + if tag == 27: + 4 [+4] UInt f27 + + if tag == 28: + 4 [+4] UInt f28 + + if tag == 29: + 4 [+4] UInt f29 + + if tag == 30: + 4 [+4] UInt f30 + + if tag == 31: + 4 [+4] UInt f31 + + if tag == 32: + 4 [+4] UInt f32 + + if tag == 33: + 4 [+4] UInt f33 + + if tag == 34: + 4 [+4] UInt f34 + + if tag == 35: + 4 [+4] UInt f35 + + if tag == 36: + 4 [+4] UInt f36 + + if tag == 37: + 4 [+4] UInt f37 + + if tag == 38: + 4 [+4] UInt f38 + + if tag == 39: + 4 [+4] UInt f39 + + if tag == 40: + 4 [+4] UInt f40 + + if tag == 41: + 4 [+4] UInt f41 + + if tag == 42: + 4 [+4] UInt f42 + + if tag == 43: + 4 [+4] UInt f43 + + if tag == 44: + 4 [+4] UInt f44 + + if tag == 45: + 4 [+4] UInt f45 + + if tag == 46: + 4 [+4] UInt f46 + + if tag == 47: + 4 [+4] UInt f47 + + if tag == 48: + 4 [+4] UInt f48 + + if tag == 49: + 4 [+4] UInt f49 + + if tag == 50: + 4 [+4] UInt f50 + + if tag == 51: + 4 [+4] UInt f51 + + if tag == 52: + 4 [+4] UInt f52 + + if tag == 53: + 4 [+4] UInt f53 + + if tag == 54: + 4 [+4] UInt f54 + + if tag == 55: + 4 [+4] UInt f55 + + if tag == 56: + 4 [+4] UInt f56 + + if tag == 57: + 4 [+4] UInt f57 + + if tag == 58: + 4 [+4] UInt f58 + + if tag == 59: + 4 [+4] UInt f59 + + if tag == 60: + 4 [+4] UInt f60 + + if tag == 61: + 4 [+4] UInt f61 + + if tag == 62: + 4 [+4] UInt f62 + + if tag == 63: + 4 [+4] UInt f63 + + if tag == 64: + 4 [+4] UInt f64 + + if tag == 65: + 4 [+4] UInt f65 + + if tag == 66: + 4 [+4] UInt f66 + + if tag == 67: + 4 [+4] UInt f67 + + if tag == 68: + 4 [+4] UInt f68 + + if tag == 69: + 4 [+4] UInt f69 + + if tag == 70: + 4 [+4] UInt f70 + + if tag == 71: + 4 [+4] UInt f71 + + if tag == 72: + 4 [+4] UInt f72 + + if tag == 73: + 4 [+4] UInt f73 + + if tag == 74: + 4 [+4] UInt f74 + + if tag == 75: + 4 [+4] UInt f75 + + if tag == 76: + 4 [+4] UInt f76 + + if tag == 77: + 4 [+4] UInt f77 + + if tag == 78: + 4 [+4] UInt f78 + + if tag == 79: + 4 [+4] UInt f79 + + if tag == 80: + 4 [+4] UInt f80 + + if tag == 81: + 4 [+4] UInt f81 + + if tag == 82: + 4 [+4] UInt f82 + + if tag == 83: + 4 [+4] UInt f83 + + if tag == 84: + 4 [+4] UInt f84 + + if tag == 85: + 4 [+4] UInt f85 + + if tag == 86: + 4 [+4] UInt f86 + + if tag == 87: + 4 [+4] UInt f87 + + if tag == 88: + 4 [+4] UInt f88 + + if tag == 89: + 4 [+4] UInt f89 + + if tag == 90: + 4 [+4] UInt f90 + + if tag == 91: + 4 [+4] UInt f91 + + if tag == 92: + 4 [+4] UInt f92 + + if tag == 93: + 4 [+4] UInt f93 + + if tag == 94: + 4 [+4] UInt f94 + + if tag == 95: + 4 [+4] UInt f95 + + if tag == 96: + 4 [+4] UInt f96 + + if tag == 97: + 4 [+4] UInt f97 + + if tag == 98: + 4 [+4] UInt f98 + + if tag == 99: + 4 [+4] UInt f99 From 8ea51fb31d3734ce0f12ed7c428e71679332b9db Mon Sep 17 00:00:00 2001 From: Aaron Webster Date: Wed, 3 Dec 2025 10:58:44 -0800 Subject: [PATCH 2/2] feat(cpp): Optimize generated C++ accessors and control flow --- .../back_end/cpp/generated_code_templates | 72 +- compiler/back_end/cpp/header_generator.py | 243 +- testdata/__init__.py | 13 - testdata/golden_cpp/alignments.emb.h | 426 +- testdata/golden_cpp/anonymous_bits.emb.h | 406 +- testdata/golden_cpp/auto_array_size.emb.h | 260 +- testdata/golden_cpp/bcd.emb.h | 478 +- testdata/golden_cpp/bits.emb.h | 874 ++-- testdata/golden_cpp/complex_offset.emb.h | 566 +-- testdata/golden_cpp/complex_structure.emb.h | 692 ++- testdata/golden_cpp/condition.emb.h | 4255 +++++++---------- testdata/golden_cpp/dynamic_size.emb.h | 1498 +++--- testdata/golden_cpp/enum.emb.h | 471 +- testdata/golden_cpp/enum_case.emb.h | 142 +- testdata/golden_cpp/explicit_sizes.emb.h | 464 +- testdata/golden_cpp/float.emb.h | 220 +- testdata/golden_cpp/imported.emb.h | 98 +- testdata/golden_cpp/imported_genfiles.emb.h | 98 +- testdata/golden_cpp/importer.emb.h | 110 +- testdata/golden_cpp/importer2.emb.h | 98 +- testdata/golden_cpp/inline_type.emb.h | 110 +- testdata/golden_cpp/int_sizes.emb.h | 182 +- testdata/golden_cpp/large_array.emb.h | 114 +- testdata/golden_cpp/nested_structure.emb.h | 342 +- testdata/golden_cpp/next_keyword.emb.h | 134 +- testdata/golden_cpp/no_enum_traits.emb.h | 98 +- testdata/golden_cpp/parameters.emb.h | 1810 +++---- testdata/golden_cpp/requires.emb.h | 1209 ++--- testdata/golden_cpp/start_size_range.emb.h | 138 +- testdata/golden_cpp/subtypes.emb.h | 572 +-- testdata/golden_cpp/text_format.emb.h | 354 +- testdata/golden_cpp/uint_sizes.emb.h | 1157 ++--- testdata/golden_cpp/virtual_field.emb.h | 2953 +++++------- 33 files changed, 8224 insertions(+), 12433 deletions(-) diff --git a/compiler/back_end/cpp/generated_code_templates b/compiler/back_end/cpp/generated_code_templates index 5ea3ca5..9a32f50 100644 --- a/compiler/back_end/cpp/generated_code_templates +++ b/compiler/back_end/cpp/generated_code_templates @@ -124,7 +124,7 @@ class Generic${name}View final { ${enum_usings} - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; ${parameter_ok_checks} ${ok_subexpressions} @@ -132,8 +132,8 @@ ${field_ok_checks} ${requires_check} return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeIn${units}().Ok() && backing_.SizeIn${units}() >= static_cast( @@ -142,12 +142,12 @@ ${requires_check} ${size_method} template - bool Equals( + [[nodiscard]] bool Equals( Generic${name}View emboss_reserved_local_other) const { ${equals_method_body} return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( Generic${name}View emboss_reserved_local_other) const { ${unchecked_equals_method_body} return true; } @@ -172,7 +172,7 @@ ${size_method} emboss_reserved_local_other.IntrinsicSizeIn${units}().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( Generic${name}View emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -181,7 +181,7 @@ ${size_method} ${text_stream_methods} - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } ${field_method_declarations} @@ -216,7 +216,7 @@ struct EmbossReservedInternalIsGeneric${name}View< }; template -inline Generic${name}View< +[[nodiscard]] inline Generic${name}View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -231,7 +231,7 @@ Make${name}View(${constructor_parameters} T &&emboss_reserved_local_arg) { } template -inline Generic${name}View> +[[nodiscard]] inline Generic${name}View> Make${name}View(${constructor_parameters} T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return Generic${name}View>( @@ -240,7 +240,7 @@ Make${name}View(${constructor_parameters} T *emboss_reserved_local_data, } template -inline Generic${name}View< +[[nodiscard]] inline Generic${name}View< /**/ ::emboss::support::ContiguousBuffer> MakeAligned${name}View( ${constructor_parameters} T *emboss_reserved_local_data, @@ -375,18 +375,18 @@ ${write_fields} } // ** constant_structure_size_method ** //////////////////////////////////////// - static constexpr ::std::size_t SizeIn${units}() { + [[nodiscard]] static constexpr ::std::size_t SizeIn${units}() { return static_cast(IntrinsicSizeIn${units}().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeIn${units}().Ok(); } // ** runtime_structure_size_method ** ///////////////////////////////////////// - ::std::size_t SizeIn${units}() const { + [[nodiscard]] ::std::size_t SizeIn${units}() const { return static_cast(IntrinsicSizeIn${units}().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeIn${units}().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeIn${units}().Ok(); } // ** ok_method_test ** //////////////////////////////////////////////////////// @@ -491,8 +491,8 @@ struct ${name} { // ** structure_single_field_method_declarations ** //////////////////////////// ${visibility}: - typename ${type_reader} ${name}() const; - ::emboss::support::Maybe has_${name}() const; + [[nodiscard]] typename ${type_reader} ${name}() const; + [[nodiscard]] ::emboss::support::Maybe has_${name}() const; // ** structure_single_field_method_definitions ** ///////////////////////////// @@ -547,9 +547,9 @@ Generic${parent_type}View::has_${name}() const { default; ~${virtual_view_type_name}() = default; - static constexpr ${logical_type} Read(); - static constexpr ${logical_type} UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ${logical_type} Read(); + [[nodiscard]] static constexpr ${logical_type} UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -558,13 +558,13 @@ Generic${parent_type}View::has_${name}() const { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr ${virtual_view_type_name} ${name}() { + [[nodiscard]] static constexpr ${virtual_view_type_name} ${name}() { return ${virtual_view_type_name}(); } - static constexpr ::emboss::support::Maybe has_${name}() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_${name}() { return ::emboss::support::Maybe(true); } @@ -607,14 +607,14 @@ Generic${parent_type}View< default; ~${virtual_view_type_name}() = default; - ${logical_type} Read() const { + [[nodiscard]] ${logical_type} Read() const { EMBOSS_CHECK(view_.has_${name}().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ${logical_type} UncheckedRead() const { + [[nodiscard]] ${logical_type} UncheckedRead() const { // UncheckedRead() on a virtual still calls Ok() on its dependencies; // i.e., it still does some bounds checking. This is because of a subtle // case, illustrated by the example below: @@ -648,7 +648,7 @@ Generic${parent_type}View< } // Ok() can be false if some dependency is unreadable, *or* if there is an // error somewhere in the arithmetic -- say, division by zero. - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -661,17 +661,17 @@ Generic${parent_type}View< this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } ${write_methods} private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { ${read_subexpressions} return ${read_value}; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ${logical_type} emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ${value_is_ok}.ValueOr(false); @@ -679,12 +679,12 @@ ${read_subexpressions} const Generic${parent_type}View view_; }; - ${virtual_view_type_name} ${name}() const; - ::emboss::support::Maybe has_${name}() const; + [[nodiscard]] ${virtual_view_type_name} ${name}() const; + [[nodiscard]] ::emboss::support::Maybe has_${name}() const; // ** structure_single_virtual_field_write_methods ** ////////////////////////// - bool TryToWrite(${logical_type} emboss_reserved_local_value) { + [[nodiscard]] bool TryToWrite(${logical_type} emboss_reserved_local_value) { const auto emboss_reserved_local_maybe_new_value = ${transform}; if (!CouldWriteValue(emboss_reserved_local_value)) return false; return view_.${destination}.TryToWrite( @@ -698,7 +698,7 @@ ${read_subexpressions} void UncheckedWrite(${logical_type} emboss_reserved_local_value) { view_.${destination}.UncheckedWrite((${transform}).ValueOrDefault()); } - bool CouldWriteValue(${logical_type} emboss_reserved_local_value) { + [[nodiscard]] bool CouldWriteValue(${logical_type} emboss_reserved_local_value) { if (!ValueIsOk(emboss_reserved_local_value)) return false; const auto emboss_reserved_local_maybe_new_value = ${transform}; if (!emboss_reserved_local_maybe_new_value.Known()) return false; @@ -731,11 +731,11 @@ Generic${parent_type}View::has_${name}() const { // ** structure_single_field_indirect_method_declarations ** /////////////////// ${visibility}: // The "this->" is required for (some versions of?) GCC. - auto ${name}() const -> decltype(this->${aliased_field}) { + [[nodiscard]] auto ${name}() const -> decltype(this->${aliased_field}) { return has_${name}().ValueOrDefault() ? ${aliased_field} : decltype(this->${aliased_field})(); } - ::emboss::support::Maybe has_${name}() const; + [[nodiscard]] ::emboss::support::Maybe has_${name}() const; // ** struct_single_field_indirect_method_definitions ** /////////////////////// @@ -749,14 +749,14 @@ Generic${parent_type}View::has_${name}() const { // ** structure_single_parameter_field_method_declarations ** ////////////////// private: // TODO(bolms): Is there any harm if these are public methods? - constexpr ::emboss::support::MaybeConstantView + [[nodiscard]] constexpr ::emboss::support::MaybeConstantView ${name}() const { return parameters_initialized_ ? ::emboss::support::MaybeConstantView( ${name}_) : ::emboss::support::MaybeConstantView(); } - constexpr ::emboss::support::Maybe has_${name}() const { + [[nodiscard]] constexpr ::emboss::support::Maybe has_${name}() const { return ::emboss::support::Maybe(parameters_initialized_); } diff --git a/compiler/back_end/cpp/header_generator.py b/compiler/back_end/cpp/header_generator.py index 8e504ad..4489d21 100644 --- a/compiler/back_end/cpp/header_generator.py +++ b/compiler/back_end/cpp/header_generator.py @@ -768,15 +768,24 @@ def render_field(self, expression, ir, subexpressions): ) -class _SubexpressionStore(object): - """Holder for subexpressions to be assigned to local variables.""" +class ExpressionScope(object): + """Holder for subexpressions to be assigned to local variables, with scoping.""" - def __init__(self, prefix): + def __init__(self, prefix, parent=None): self._prefix = prefix + self._parent = parent self._subexpr_to_name = {} self._index_to_subexpr = [] def add(self, subexpr): + # Check if expression exists in current or parent scopes + scope = self + while scope: + if subexpr in scope._subexpr_to_name: + return scope._subexpr_to_name[subexpr] + scope = scope._parent + + # Not found, add to current scope if subexpr not in self._subexpr_to_name: self._index_to_subexpr.append(subexpr) self._subexpr_to_name[subexpr] = self._prefix + str( @@ -790,43 +799,13 @@ def subexprs(self): for subexpr in self._index_to_subexpr ] - -class _UsageCountingStore(object): - """A mock SubexpressionStore that counts subexpression usage.""" - - def __init__(self): - self.counts = collections.defaultdict(int) - - def add(self, subexpr): - self.counts[subexpr] += 1 - return subexpr - - -class _SmartSubexpressionStore(object): - """A SubexpressionStore that only caches subexpressions used multiple times.""" - - def __init__(self, prefix, counts): - self._prefix = prefix - self._counts = counts - self._subexpr_to_name = {} - self._index_to_subexpr = [] - - def add(self, subexpr): - if self._counts[subexpr] <= 1: - return subexpr - - if subexpr not in self._subexpr_to_name: - self._index_to_subexpr.append(subexpr) - self._subexpr_to_name[subexpr] = self._prefix + str( - len(self._index_to_subexpr) - ) - return self._subexpr_to_name[subexpr] - - def subexprs(self): - return [ - (self._subexpr_to_name[subexpr], subexpr) - for subexpr in self._index_to_subexpr - ] + def definition_code(self): + return "".join( + [ + " const auto {} = {};\n".format(name, subexpr) + for name, subexpr in self.subexprs() + ] + ) _ExpressionResult = collections.namedtuple( @@ -842,7 +821,7 @@ def _render_expression(expression, ir, field_reader=None, subexpressions=None): ir: The IR in which to look up references. field_reader: An object with render_existence and render_field methods appropriate for the C++ context of the expression. - subexpressions: A _SubexpressionStore in which to put subexpressions, or + subexpressions: A ExpressionScope in which to put subexpressions, or None if subexpressions should be inline. Returns: @@ -1023,7 +1002,7 @@ def _generate_structure_virtual_field_methods(enclosing_type_name, field_ir, ir) if field_ir.write_method.which_method == "alias": return _generate_field_indirection(field_ir, enclosing_type_name, ir) - read_subexpressions = _SubexpressionStore("emboss_reserved_local_subexpr_") + read_subexpressions = ExpressionScope("emboss_reserved_local_subexpr_") read_value = _render_expression( field_ir.read_transform, ir, @@ -1177,7 +1156,7 @@ def _generate_structure_physical_field_methods( field_name = field_ir.name.canonical_name.object_path[-1] - subexpressions = _SubexpressionStore("emboss_reserved_local_subexpr_") + subexpressions = ExpressionScope("emboss_reserved_local_subexpr_") parameter_values = [] parameters_known = [] for parameter in parameter_expressions: @@ -1370,6 +1349,143 @@ def _cpp_field_name(name): return name +def _is_equality_check(expression): + return ( + expression.which_expression == "function" + and expression.function.function == ir_data.FunctionMapping.EQUALITY + and len(expression.function.args) == 2 + ) + + +def _render_case_label(expression, ir): + if expression.type.which_type == "integer": + return _render_integer(int(expression.type.integer.modular_value)) + elif expression.type.which_type == "enumeration": + # Need fully qualified enum type name + enum_type = expression.type.enumeration + cpp_enum_type = _get_fully_qualified_name(enum_type.name.canonical_name, ir) + return "static_cast({})".format(cpp_enum_type, enum_type.value) + else: + assert False, "Unsupported switch case type" + + +def _get_switch_candidate(expression, ir): + """Returns (discriminant_expr, case_value_expr) or (None, None).""" + if not _is_equality_check(expression): + return None, None + + arg0 = expression.function.args[0] + arg1 = expression.function.args[1] + + # Check if args are integer or enumeration (ignore boolean for switch) + if arg0.type.which_type not in ("integer", "enumeration"): + return None, None + + res0 = _render_expression(arg0, ir, subexpressions=None) + res1 = _render_expression(arg1, ir, subexpressions=None) + + if res0.is_constant and not res1.is_constant: + return arg1, arg0 + if res1.is_constant and not res0.is_constant: + return arg0, arg1 + + return None, None + + +def _generate_optimized_ok_method_body(fields, ir, subexpressions): + groups = {} + ordered_keys = [] + + for field in fields: + discrim_expr, case_expr = _get_switch_candidate(field.existence_condition, ir) + if discrim_expr: + discrim_str = _render_expression( + discrim_expr, ir, subexpressions=None + ).rendered + key = "SWITCH:" + discrim_str + if key not in groups: + groups[key] = {"type": "switch", "expr": discrim_expr, "cases": []} + ordered_keys.append(key) + + case_str = _render_case_label(case_expr, ir) + groups[key]["cases"].append((case_str, field)) + else: + cond_res = _render_expression( + field.existence_condition, ir, subexpressions=None + ) + key = "IF:" + cond_res.rendered + if key not in groups: + groups[key] = { + "type": "if", + "expr": field.existence_condition, + "fields": [], + } + ordered_keys.append(key) + groups[key]["fields"].append(field) + + lines = [] + for key in ordered_keys: + group = groups[key] + if group["type"] == "switch": + discrim_rendered = _render_expression( + group["expr"], ir, subexpressions=subexpressions + ).rendered + lines.append(" {") + # Create a new scope for the switch block + inner_scope = ExpressionScope( + "emboss_reserved_switch_scope_", parent=subexpressions + ) + lines.append(inner_scope.definition_code().rstrip()) + + lines.append( + " const auto emboss_reserved_switch_discrim = {};".format( + discrim_rendered + ) + ) + lines.append( + " if (!emboss_reserved_switch_discrim.Known()) return false;" + ) + lines.append( + " switch (emboss_reserved_switch_discrim.ValueOrDefault()) {" + ) + for case_val, field in group["cases"]: + lines.append(" case {}:".format(case_val)) + lines.append( + " if (!{}().Ok()) return false;".format( + _cpp_field_name(field.name.name.text) + ) + ) + lines.append(" break;") + lines.append(" }") + lines.append(" }") + else: + cond_rendered = _render_expression( + group["expr"], ir, subexpressions=subexpressions + ).rendered + lines.append(" {") + # Create a new scope for the if block + inner_scope = ExpressionScope( + "emboss_reserved_if_scope_", parent=subexpressions + ) + lines.append(inner_scope.definition_code().rstrip()) + + lines.append( + " const auto emboss_reserved_cond = {};".format(cond_rendered) + ) + lines.append(" if (!emboss_reserved_cond.Known()) return false;") + lines.append(" if (emboss_reserved_cond.ValueOrDefault()) {") + for field in group["fields"]: + lines.append( + " if (!{}().Ok()) return false;".format( + _cpp_field_name(field.name.name.text) + ) + ) + lines.append(" }") + lines.append(" }") + + return "\n".join([line for line in lines if line.strip()]) + + def _generate_structure_definition(type_ir, ir, config: Config): """Generates C++ for an Emboss structure (struct or bits). @@ -1393,7 +1509,7 @@ def _generate_structure_definition(type_ir, ir, config: Config): virtual_field_type_definitions = [] decode_field_clauses = [] write_field_clauses = [] - ok_method_clauses = [] + equals_method_clauses = [] unchecked_equals_method_clauses = [] enum_using_statements = [] @@ -1461,16 +1577,8 @@ def _generate_structure_definition(type_ir, ir, config: Config): initialize_parameters_initialized_true = "" parameter_checks = [""] - # Pass 1: Count subexpression usage. - ok_usage_counter = _UsageCountingStore() - for field_index in type_ir.structure.fields_in_dependency_order: - field = type_ir.structure.field[field_index] - _render_existence_test(field, ir, ok_usage_counter) - - # Pass 2: Generate code using smart store. - ok_subexpressions = _SmartSubexpressionStore( - "emboss_reserved_local_ok_subexpr_", ok_usage_counter.counts - ) + # Generate code using subexpression store. + ok_subexpressions = ExpressionScope("emboss_reserved_local_ok_subexpr_") for field_index in type_ir.structure.fields_in_dependency_order: field = type_ir.structure.field[field_index] helper_types, declaration, definition = _generate_structure_field_methods( @@ -1478,15 +1586,6 @@ def _generate_structure_definition(type_ir, ir, config: Config): ) field_helper_type_definitions.append(helper_types) field_method_definitions.append(definition) - ok_method_clauses.append( - code_template.format_template( - _TEMPLATES.ok_method_test, - field=_cpp_field_name(field.name.name.text) + "()", - existence_condition=_render_existence_test( - field, ir, subexpressions=ok_subexpressions - ).rendered, - ) - ) if not ir_util.field_is_virtual(field): # Virtual fields do not participate in equality tests -- they are equal by # definition. @@ -1543,6 +1642,15 @@ def _generate_structure_definition(type_ir, ir, config: Config): else: text_stream_methods = "" + field_ok_checks_body = _generate_optimized_ok_method_body( + [ + type_ir.structure.field[i] + for i in type_ir.structure.fields_in_dependency_order + ], + ir, + ok_subexpressions, + ) + class_forward_declarations = code_template.format_template( _TEMPLATES.structure_view_declaration, name=type_name ) @@ -1551,13 +1659,8 @@ def _generate_structure_definition(type_ir, ir, config: Config): name=type_ir.name.canonical_name.object_path[-1], size_method=_render_size_method(type_ir.structure.field, ir), field_method_declarations="".join(field_method_declarations), - field_ok_checks="\n".join(ok_method_clauses), - ok_subexpressions="".join( - [ - " const auto {} = {};\n".format(name, subexpr) - for name, subexpr in ok_subexpressions.subexprs() - ] - ), + field_ok_checks=field_ok_checks_body, + ok_subexpressions=ok_subexpressions.definition_code(), parameter_ok_checks="\n".join(parameter_checks), requires_check=requires_check, equals_method_body="\n".join(equals_method_clauses), diff --git a/testdata/__init__.py b/testdata/__init__.py index 086a24e..e69de29 100644 --- a/testdata/__init__.py +++ b/testdata/__init__.py @@ -1,13 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/testdata/golden_cpp/alignments.emb.h b/testdata/golden_cpp/alignments.emb.h index f225198..28b0042 100644 --- a/testdata/golden_cpp/alignments.emb.h +++ b/testdata/golden_cpp/alignments.emb.h @@ -113,128 +113,50 @@ class GenericAlignmentsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !zero_offset().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !zero_offset_substructure().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !two_offset_substructure().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !three_offset().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !four_offset().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !eleven_offset().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !twelve_offset().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !zero_offset_four_stride_array().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !zero_offset_six_stride_array().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !three_offset_four_stride_array().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !four_offset_six_stride_array().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!zero_offset().Ok()) return false; + if (!zero_offset_substructure().Ok()) return false; + if (!two_offset_substructure().Ok()) return false; + if (!three_offset().Ok()) return false; + if (!four_offset().Ok()) return false; + if (!eleven_offset().Ok()) return false; + if (!twelve_offset().Ok()) return false; + if (!zero_offset_four_stride_array().Ok()) return false; + if (!zero_offset_six_stride_array().Ok()) return false; + if (!three_offset_four_stride_array().Ok()) return false; + if (!four_offset_six_stride_array().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericAlignmentsView emboss_reserved_local_other) const { if (!has_zero_offset().Known()) return false; @@ -425,7 +347,7 @@ class GenericAlignmentsView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericAlignmentsView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_zero_offset().ValueOr(false) && @@ -598,7 +520,7 @@ class GenericAlignmentsView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericAlignmentsView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1073,89 +995,89 @@ class GenericAlignmentsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::test::GenericPlaceholder4View> + [[nodiscard]] typename ::emboss::test::GenericPlaceholder4View> zero_offset() const; - ::emboss::support::Maybe has_zero_offset() const; + [[nodiscard]] ::emboss::support::Maybe has_zero_offset() const; public: - typename ::emboss::test::GenericPlaceholder6View> + [[nodiscard]] typename ::emboss::test::GenericPlaceholder6View> zero_offset_substructure() const; - ::emboss::support::Maybe has_zero_offset_substructure() const; + [[nodiscard]] ::emboss::support::Maybe has_zero_offset_substructure() const; public: - typename ::emboss::test::GenericPlaceholder6View> + [[nodiscard]] typename ::emboss::test::GenericPlaceholder6View> two_offset_substructure() const; - ::emboss::support::Maybe has_two_offset_substructure() const; + [[nodiscard]] ::emboss::support::Maybe has_two_offset_substructure() const; public: - typename ::emboss::test::GenericPlaceholder4View> + [[nodiscard]] typename ::emboss::test::GenericPlaceholder4View> three_offset() const; - ::emboss::support::Maybe has_three_offset() const; + [[nodiscard]] ::emboss::support::Maybe has_three_offset() const; public: - typename ::emboss::test::GenericPlaceholder4View> + [[nodiscard]] typename ::emboss::test::GenericPlaceholder4View> four_offset() const; - ::emboss::support::Maybe has_four_offset() const; + [[nodiscard]] ::emboss::support::Maybe has_four_offset() const; public: - typename ::emboss::test::GenericPlaceholder4View> + [[nodiscard]] typename ::emboss::test::GenericPlaceholder4View> eleven_offset() const; - ::emboss::support::Maybe has_eleven_offset() const; + [[nodiscard]] ::emboss::support::Maybe has_eleven_offset() const; public: - typename ::emboss::test::GenericPlaceholder4View> + [[nodiscard]] typename ::emboss::test::GenericPlaceholder4View> twelve_offset() const; - ::emboss::support::Maybe has_twelve_offset() const; + [[nodiscard]] ::emboss::support::Maybe has_twelve_offset() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::test::GenericPlaceholder4View::template OffsetStorageType> , typename Storage::template OffsetStorageType, 4, 8 > zero_offset_four_stride_array() const; - ::emboss::support::Maybe has_zero_offset_four_stride_array() const; + [[nodiscard]] ::emboss::support::Maybe has_zero_offset_four_stride_array() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::test::GenericPlaceholder6View::template OffsetStorageType> , typename Storage::template OffsetStorageType, 6, 8 > zero_offset_six_stride_array() const; - ::emboss::support::Maybe has_zero_offset_six_stride_array() const; + [[nodiscard]] ::emboss::support::Maybe has_zero_offset_six_stride_array() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::test::GenericPlaceholder4View::template OffsetStorageType> , typename Storage::template OffsetStorageType, 4, 8 > three_offset_four_stride_array() const; - ::emboss::support::Maybe has_three_offset_four_stride_array() const; + [[nodiscard]] ::emboss::support::Maybe has_three_offset_four_stride_array() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::test::GenericPlaceholder6View::template OffsetStorageType> , typename Storage::template OffsetStorageType, 6, 8 > four_offset_six_stride_array() const; - ::emboss::support::Maybe has_four_offset_six_stride_array() const; + [[nodiscard]] ::emboss::support::Maybe has_four_offset_six_stride_array() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -1171,9 +1093,9 @@ class GenericAlignmentsView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1182,13 +1104,13 @@ class GenericAlignmentsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1206,9 +1128,9 @@ class GenericAlignmentsView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1217,13 +1139,13 @@ class GenericAlignmentsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1241,9 +1163,9 @@ class GenericAlignmentsView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1252,13 +1174,13 @@ class GenericAlignmentsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1289,7 +1211,7 @@ struct EmbossReservedInternalIsGenericAlignmentsView< }; template -inline GenericAlignmentsView< +[[nodiscard]] inline GenericAlignmentsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1304,7 +1226,7 @@ MakeAlignmentsView( T &&emboss_reserved_local_arg) { } template -inline GenericAlignmentsView> +[[nodiscard]] inline GenericAlignmentsView> MakeAlignmentsView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericAlignmentsView>( @@ -1313,7 +1235,7 @@ MakeAlignmentsView( T *emboss_reserved_local_data, } template -inline GenericAlignmentsView< +[[nodiscard]] inline GenericAlignmentsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedAlignmentsView( T *emboss_reserved_local_data, @@ -1378,58 +1300,40 @@ class GenericPlaceholder4View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !dummy().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!dummy().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericPlaceholder4View emboss_reserved_local_other) const { if (!has_dummy().Known()) return false; @@ -1450,7 +1354,7 @@ class GenericPlaceholder4View final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericPlaceholder4View emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_dummy().ValueOr(false) && @@ -1483,7 +1387,7 @@ class GenericPlaceholder4View final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericPlaceholder4View emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1578,15 +1482,15 @@ class GenericPlaceholder4View final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> dummy() const; - ::emboss::support::Maybe has_dummy() const; + [[nodiscard]] ::emboss::support::Maybe has_dummy() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -1602,9 +1506,9 @@ class GenericPlaceholder4View final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1613,13 +1517,13 @@ class GenericPlaceholder4View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1637,9 +1541,9 @@ class GenericPlaceholder4View final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1648,13 +1552,13 @@ class GenericPlaceholder4View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1672,9 +1576,9 @@ class GenericPlaceholder4View final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1683,13 +1587,13 @@ class GenericPlaceholder4View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1720,7 +1624,7 @@ struct EmbossReservedInternalIsGenericPlaceholder4View< }; template -inline GenericPlaceholder4View< +[[nodiscard]] inline GenericPlaceholder4View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1735,7 +1639,7 @@ MakePlaceholder4View( T &&emboss_reserved_local_arg) { } template -inline GenericPlaceholder4View> +[[nodiscard]] inline GenericPlaceholder4View> MakePlaceholder4View( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericPlaceholder4View>( @@ -1744,7 +1648,7 @@ MakePlaceholder4View( T *emboss_reserved_local_data, } template -inline GenericPlaceholder4View< +[[nodiscard]] inline GenericPlaceholder4View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedPlaceholder4View( T *emboss_reserved_local_data, @@ -1810,65 +1714,41 @@ class GenericPlaceholder6View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !zero_offset().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !two_offset().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!zero_offset().Ok()) return false; + if (!two_offset().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericPlaceholder6View emboss_reserved_local_other) const { if (!has_zero_offset().Known()) return false; @@ -1906,7 +1786,7 @@ class GenericPlaceholder6View final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericPlaceholder6View emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_zero_offset().ValueOr(false) && @@ -1953,7 +1833,7 @@ class GenericPlaceholder6View final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericPlaceholder6View emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -2086,19 +1966,19 @@ class GenericPlaceholder6View final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::test::GenericPlaceholder4View> + [[nodiscard]] typename ::emboss::test::GenericPlaceholder4View> zero_offset() const; - ::emboss::support::Maybe has_zero_offset() const; + [[nodiscard]] ::emboss::support::Maybe has_zero_offset() const; public: - typename ::emboss::test::GenericPlaceholder4View> + [[nodiscard]] typename ::emboss::test::GenericPlaceholder4View> two_offset() const; - ::emboss::support::Maybe has_two_offset() const; + [[nodiscard]] ::emboss::support::Maybe has_two_offset() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -2114,9 +1994,9 @@ class GenericPlaceholder6View final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2125,13 +2005,13 @@ class GenericPlaceholder6View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2149,9 +2029,9 @@ class GenericPlaceholder6View final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2160,13 +2040,13 @@ class GenericPlaceholder6View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2184,9 +2064,9 @@ class GenericPlaceholder6View final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2195,13 +2075,13 @@ class GenericPlaceholder6View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2232,7 +2112,7 @@ struct EmbossReservedInternalIsGenericPlaceholder6View< }; template -inline GenericPlaceholder6View< +[[nodiscard]] inline GenericPlaceholder6View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2247,7 +2127,7 @@ MakePlaceholder6View( T &&emboss_reserved_local_arg) { } template -inline GenericPlaceholder6View> +[[nodiscard]] inline GenericPlaceholder6View> MakePlaceholder6View( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericPlaceholder6View>( @@ -2256,7 +2136,7 @@ MakePlaceholder6View( T *emboss_reserved_local_data, } template -inline GenericPlaceholder6View< +[[nodiscard]] inline GenericPlaceholder6View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedPlaceholder6View( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/anonymous_bits.emb.h b/testdata/golden_cpp/anonymous_bits.emb.h index 42b1aac..bc2c174 100644 --- a/testdata/golden_cpp/anonymous_bits.emb.h +++ b/testdata/golden_cpp/anonymous_bits.emb.h @@ -119,72 +119,42 @@ class GenericEmbossReservedAnonymousField2View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !high_bit().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !bar().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !first_bit().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!high_bit().Ok()) return false; + if (!bar().Ok()) return false; + if (!first_bit().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericEmbossReservedAnonymousField2View emboss_reserved_local_other) const { if (!has_high_bit().Known()) return false; @@ -239,7 +209,7 @@ class GenericEmbossReservedAnonymousField2View final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericEmbossReservedAnonymousField2View emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_high_bit().ValueOr(false) && @@ -300,7 +270,7 @@ class GenericEmbossReservedAnonymousField2View final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericEmbossReservedAnonymousField2View emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -471,32 +441,32 @@ class GenericEmbossReservedAnonymousField2View final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> high_bit() const; - ::emboss::support::Maybe has_high_bit() const; + [[nodiscard]] ::emboss::support::Maybe has_high_bit() const; public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::Foo::Bar, ::emboss::support::FixedSizeViewParameters<4, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> bar() const; - ::emboss::support::Maybe has_bar() const; + [[nodiscard]] ::emboss::support::Maybe has_bar() const; public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> first_bit() const; - ::emboss::support::Maybe has_first_bit() const; + [[nodiscard]] ::emboss::support::Maybe has_first_bit() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -512,9 +482,9 @@ class GenericEmbossReservedAnonymousField2View final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -523,13 +493,13 @@ class GenericEmbossReservedAnonymousField2View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -547,9 +517,9 @@ class GenericEmbossReservedAnonymousField2View final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -558,13 +528,13 @@ class GenericEmbossReservedAnonymousField2View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -582,9 +552,9 @@ class GenericEmbossReservedAnonymousField2View final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -593,13 +563,13 @@ class GenericEmbossReservedAnonymousField2View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -630,7 +600,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField2View< }; template -inline GenericEmbossReservedAnonymousField2View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField2View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -645,7 +615,7 @@ MakeEmbossReservedAnonymousField2View( T &&emboss_reserved_local_arg) { } template -inline GenericEmbossReservedAnonymousField2View> +[[nodiscard]] inline GenericEmbossReservedAnonymousField2View> MakeEmbossReservedAnonymousField2View( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericEmbossReservedAnonymousField2View>( @@ -654,7 +624,7 @@ MakeEmbossReservedAnonymousField2View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField2View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField2View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField2View( T *emboss_reserved_local_data, @@ -809,65 +779,41 @@ class GenericEmbossReservedAnonymousField1View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !bit_23().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !low_bit().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!bit_23().Ok()) return false; + if (!low_bit().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { if (!has_bit_23().Known()) return false; @@ -905,7 +851,7 @@ class GenericEmbossReservedAnonymousField1View final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_bit_23().ValueOr(false) && @@ -952,7 +898,7 @@ class GenericEmbossReservedAnonymousField1View final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1085,23 +1031,23 @@ class GenericEmbossReservedAnonymousField1View final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> bit_23() const; - ::emboss::support::Maybe has_bit_23() const; + [[nodiscard]] ::emboss::support::Maybe has_bit_23() const; public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> low_bit() const; - ::emboss::support::Maybe has_low_bit() const; + [[nodiscard]] ::emboss::support::Maybe has_low_bit() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -1117,9 +1063,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1128,13 +1074,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1152,9 +1098,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1163,13 +1109,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1187,9 +1133,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1198,13 +1144,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1235,7 +1181,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField1View< }; template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1250,7 +1196,7 @@ MakeEmbossReservedAnonymousField1View( T &&emboss_reserved_local_arg) { } template -inline GenericEmbossReservedAnonymousField1View> +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View> MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericEmbossReservedAnonymousField1View>( @@ -1259,7 +1205,7 @@ MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, @@ -1320,101 +1266,53 @@ class GenericFooView final { using Bar = ::emboss::test::Foo::Bar; - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_2().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !high_bit().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !bar().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !first_bit().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !bit_23().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !low_bit().Ok()) return false; - } - + const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!emboss_reserved_anonymous_field_2().Ok()) return false; + if (!emboss_reserved_anonymous_field_1().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!high_bit().Ok()) return false; + if (!bar().Ok()) return false; + if (!first_bit().Ok()) return false; + if (!bit_23().Ok()) return false; + if (!low_bit().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericFooView emboss_reserved_local_other) const { if (!has_emboss_reserved_anonymous_field_2().Known()) return false; @@ -1452,7 +1350,7 @@ class GenericFooView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericFooView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_emboss_reserved_anonymous_field_2().ValueOr(false) && @@ -1499,7 +1397,7 @@ class GenericFooView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericFooView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1746,54 +1644,54 @@ class GenericFooView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } private: - typename ::emboss::test::Foo::GenericEmbossReservedAnonymousField2View>, 32>> + [[nodiscard]] typename ::emboss::test::Foo::GenericEmbossReservedAnonymousField2View>, 32>> emboss_reserved_anonymous_field_2() const; - ::emboss::support::Maybe has_emboss_reserved_anonymous_field_2() const; + [[nodiscard]] ::emboss::support::Maybe has_emboss_reserved_anonymous_field_2() const; public: - auto high_bit() const -> decltype(this->emboss_reserved_anonymous_field_2().high_bit()) { + [[nodiscard]] auto high_bit() const -> decltype(this->emboss_reserved_anonymous_field_2().high_bit()) { return has_high_bit().ValueOrDefault() ? emboss_reserved_anonymous_field_2().high_bit() : decltype(this->emboss_reserved_anonymous_field_2().high_bit())(); } - ::emboss::support::Maybe has_high_bit() const; + [[nodiscard]] ::emboss::support::Maybe has_high_bit() const; public: - auto bar() const -> decltype(this->emboss_reserved_anonymous_field_2().bar()) { + [[nodiscard]] auto bar() const -> decltype(this->emboss_reserved_anonymous_field_2().bar()) { return has_bar().ValueOrDefault() ? emboss_reserved_anonymous_field_2().bar() : decltype(this->emboss_reserved_anonymous_field_2().bar())(); } - ::emboss::support::Maybe has_bar() const; + [[nodiscard]] ::emboss::support::Maybe has_bar() const; public: - auto first_bit() const -> decltype(this->emboss_reserved_anonymous_field_2().first_bit()) { + [[nodiscard]] auto first_bit() const -> decltype(this->emboss_reserved_anonymous_field_2().first_bit()) { return has_first_bit().ValueOrDefault() ? emboss_reserved_anonymous_field_2().first_bit() : decltype(this->emboss_reserved_anonymous_field_2().first_bit())(); } - ::emboss::support::Maybe has_first_bit() const; + [[nodiscard]] ::emboss::support::Maybe has_first_bit() const; private: - typename ::emboss::test::Foo::GenericEmbossReservedAnonymousField1View>, 32>> + [[nodiscard]] typename ::emboss::test::Foo::GenericEmbossReservedAnonymousField1View>, 32>> emboss_reserved_anonymous_field_1() const; - ::emboss::support::Maybe has_emboss_reserved_anonymous_field_1() const; + [[nodiscard]] ::emboss::support::Maybe has_emboss_reserved_anonymous_field_1() const; public: - auto bit_23() const -> decltype(this->emboss_reserved_anonymous_field_1().bit_23()) { + [[nodiscard]] auto bit_23() const -> decltype(this->emboss_reserved_anonymous_field_1().bit_23()) { return has_bit_23().ValueOrDefault() ? emboss_reserved_anonymous_field_1().bit_23() : decltype(this->emboss_reserved_anonymous_field_1().bit_23())(); } - ::emboss::support::Maybe has_bit_23() const; + [[nodiscard]] ::emboss::support::Maybe has_bit_23() const; public: - auto low_bit() const -> decltype(this->emboss_reserved_anonymous_field_1().low_bit()) { + [[nodiscard]] auto low_bit() const -> decltype(this->emboss_reserved_anonymous_field_1().low_bit()) { return has_low_bit().ValueOrDefault() ? emboss_reserved_anonymous_field_1().low_bit() : decltype(this->emboss_reserved_anonymous_field_1().low_bit())(); } - ::emboss::support::Maybe has_low_bit() const; + [[nodiscard]] ::emboss::support::Maybe has_low_bit() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -1809,9 +1707,9 @@ class GenericFooView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1820,13 +1718,13 @@ class GenericFooView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1844,9 +1742,9 @@ class GenericFooView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1855,13 +1753,13 @@ class GenericFooView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1879,9 +1777,9 @@ class GenericFooView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1890,13 +1788,13 @@ class GenericFooView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1927,7 +1825,7 @@ struct EmbossReservedInternalIsGenericFooView< }; template -inline GenericFooView< +[[nodiscard]] inline GenericFooView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1942,7 +1840,7 @@ MakeFooView( T &&emboss_reserved_local_arg) { } template -inline GenericFooView> +[[nodiscard]] inline GenericFooView> MakeFooView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericFooView>( @@ -1951,7 +1849,7 @@ MakeFooView( T *emboss_reserved_local_data, } template -inline GenericFooView< +[[nodiscard]] inline GenericFooView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedFooView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/auto_array_size.emb.h b/testdata/golden_cpp/auto_array_size.emb.h index 66e01f0..e4b01f4 100644 --- a/testdata/golden_cpp/auto_array_size.emb.h +++ b/testdata/golden_cpp/auto_array_size.emb.h @@ -96,65 +96,41 @@ class GenericElementView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a().Ok()) return false; + if (!b().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericElementView emboss_reserved_local_other) const { if (!has_a().Known()) return false; @@ -192,7 +168,7 @@ class GenericElementView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericElementView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_a().ValueOr(false) && @@ -239,7 +215,7 @@ class GenericElementView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericElementView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -372,23 +348,23 @@ class GenericElementView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> a() const; - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> b() const; - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -404,9 +380,9 @@ class GenericElementView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -415,13 +391,13 @@ class GenericElementView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -439,9 +415,9 @@ class GenericElementView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -450,13 +426,13 @@ class GenericElementView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -474,9 +450,9 @@ class GenericElementView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -485,13 +461,13 @@ class GenericElementView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -522,7 +498,7 @@ struct EmbossReservedInternalIsGenericElementView< }; template -inline GenericElementView< +[[nodiscard]] inline GenericElementView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -537,7 +513,7 @@ MakeElementView( T &&emboss_reserved_local_arg) { } template -inline GenericElementView> +[[nodiscard]] inline GenericElementView> MakeElementView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericElementView>( @@ -546,7 +522,7 @@ MakeElementView( T *emboss_reserved_local_data, } template -inline GenericElementView< +[[nodiscard]] inline GenericElementView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedElementView( T *emboss_reserved_local_data, @@ -615,85 +591,43 @@ class GenericAutoSizeView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !array_size().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !four_byte_array().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !four_struct_array().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !dynamic_byte_array().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !dynamic_struct_array().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!array_size().Ok()) return false; + if (!four_byte_array().Ok()) return false; + if (!four_struct_array().Ok()) return false; + if (!dynamic_byte_array().Ok()) return false; + if (!dynamic_struct_array().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericAutoSizeView emboss_reserved_local_other) const { if (!has_array_size().Known()) return false; @@ -782,7 +716,7 @@ class GenericAutoSizeView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericAutoSizeView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_array_size().ValueOr(false) && @@ -871,7 +805,7 @@ class GenericAutoSizeView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericAutoSizeView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1118,18 +1052,18 @@ class GenericAutoSizeView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> array_size() const; - ::emboss::support::Maybe has_array_size() const; + [[nodiscard]] ::emboss::support::Maybe has_array_size() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 8>> @@ -1138,20 +1072,20 @@ class GenericAutoSizeView final { 8 > four_byte_array() const; - ::emboss::support::Maybe has_four_byte_array() const; + [[nodiscard]] ::emboss::support::Maybe has_four_byte_array() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::test::GenericElementView::template OffsetStorageType> , typename Storage::template OffsetStorageType, 2, 8 > four_struct_array() const; - ::emboss::support::Maybe has_four_struct_array() const; + [[nodiscard]] ::emboss::support::Maybe has_four_struct_array() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 8>> @@ -1160,17 +1094,17 @@ class GenericAutoSizeView final { 8 > dynamic_byte_array() const; - ::emboss::support::Maybe has_dynamic_byte_array() const; + [[nodiscard]] ::emboss::support::Maybe has_dynamic_byte_array() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::test::GenericElementView::template OffsetStorageType> , typename Storage::template OffsetStorageType, 2, 8 > dynamic_struct_array() const; - ::emboss::support::Maybe has_dynamic_struct_array() const; + [[nodiscard]] ::emboss::support::Maybe has_dynamic_struct_array() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -1189,17 +1123,17 @@ class GenericAutoSizeView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -1212,12 +1146,12 @@ class GenericAutoSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.array_size(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(::emboss::support::Maybe(static_cast(13LL)), emboss_reserved_local_subexpr_2); @@ -1230,7 +1164,7 @@ class GenericAutoSizeView final { return emboss_reserved_local_subexpr_8; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -1238,8 +1172,8 @@ class GenericAutoSizeView final { const GenericAutoSizeView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -1255,9 +1189,9 @@ class GenericAutoSizeView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1266,13 +1200,13 @@ class GenericAutoSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1290,9 +1224,9 @@ class GenericAutoSizeView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1301,13 +1235,13 @@ class GenericAutoSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1338,7 +1272,7 @@ struct EmbossReservedInternalIsGenericAutoSizeView< }; template -inline GenericAutoSizeView< +[[nodiscard]] inline GenericAutoSizeView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1353,7 +1287,7 @@ MakeAutoSizeView( T &&emboss_reserved_local_arg) { } template -inline GenericAutoSizeView> +[[nodiscard]] inline GenericAutoSizeView> MakeAutoSizeView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericAutoSizeView>( @@ -1362,7 +1296,7 @@ MakeAutoSizeView( T *emboss_reserved_local_data, } template -inline GenericAutoSizeView< +[[nodiscard]] inline GenericAutoSizeView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedAutoSizeView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/bcd.emb.h b/testdata/golden_cpp/bcd.emb.h index c10e884..a92c0b0 100644 --- a/testdata/golden_cpp/bcd.emb.h +++ b/testdata/golden_cpp/bcd.emb.h @@ -122,79 +122,43 @@ class GenericEmbossReservedAnonymousField1View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !four_bit().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !six_bit().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !ten_bit().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !twelve_bit().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!four_bit().Ok()) return false; + if (!six_bit().Ok()) return false; + if (!ten_bit().Ok()) return false; + if (!twelve_bit().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { if (!has_four_bit().Known()) return false; @@ -266,7 +230,7 @@ class GenericEmbossReservedAnonymousField1View final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_four_bit().ValueOr(false) && @@ -341,7 +305,7 @@ class GenericEmbossReservedAnonymousField1View final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -550,39 +514,39 @@ class GenericEmbossReservedAnonymousField1View final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::BcdView< + [[nodiscard]] typename ::emboss::prelude::BcdView< /**/ ::emboss::support::FixedSizeViewParameters<4, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> four_bit() const; - ::emboss::support::Maybe has_four_bit() const; + [[nodiscard]] ::emboss::support::Maybe has_four_bit() const; public: - typename ::emboss::prelude::BcdView< + [[nodiscard]] typename ::emboss::prelude::BcdView< /**/ ::emboss::support::FixedSizeViewParameters<6, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> six_bit() const; - ::emboss::support::Maybe has_six_bit() const; + [[nodiscard]] ::emboss::support::Maybe has_six_bit() const; public: - typename ::emboss::prelude::BcdView< + [[nodiscard]] typename ::emboss::prelude::BcdView< /**/ ::emboss::support::FixedSizeViewParameters<10, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> ten_bit() const; - ::emboss::support::Maybe has_ten_bit() const; + [[nodiscard]] ::emboss::support::Maybe has_ten_bit() const; public: - typename ::emboss::prelude::BcdView< + [[nodiscard]] typename ::emboss::prelude::BcdView< /**/ ::emboss::support::FixedSizeViewParameters<12, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> twelve_bit() const; - ::emboss::support::Maybe has_twelve_bit() const; + [[nodiscard]] ::emboss::support::Maybe has_twelve_bit() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -598,9 +562,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -609,13 +573,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -633,9 +597,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -644,13 +608,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -668,9 +632,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -679,13 +643,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -716,7 +680,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField1View< }; template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -731,7 +695,7 @@ MakeEmbossReservedAnonymousField1View( T &&emboss_reserved_local_arg) { } template -inline GenericEmbossReservedAnonymousField1View> +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View> MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericEmbossReservedAnonymousField1View>( @@ -740,7 +704,7 @@ MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, @@ -801,143 +765,59 @@ class GenericBcdSizesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !two_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !three_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !four_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !five_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !six_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !seven_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !eight_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !four_bit().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !six_bit().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !ten_bit().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !twelve_bit().Ok()) return false; - } - + const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!one_byte().Ok()) return false; + if (!two_byte().Ok()) return false; + if (!three_byte().Ok()) return false; + if (!four_byte().Ok()) return false; + if (!five_byte().Ok()) return false; + if (!six_byte().Ok()) return false; + if (!seven_byte().Ok()) return false; + if (!eight_byte().Ok()) return false; + if (!emboss_reserved_anonymous_field_1().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!four_bit().Ok()) return false; + if (!six_bit().Ok()) return false; + if (!ten_bit().Ok()) return false; + if (!twelve_bit().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericBcdSizesView emboss_reserved_local_other) const { if (!has_one_byte().Known()) return false; @@ -1094,7 +974,7 @@ class GenericBcdSizesView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericBcdSizesView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_one_byte().ValueOr(false) && @@ -1239,7 +1119,7 @@ class GenericBcdSizesView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericBcdSizesView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1752,105 +1632,105 @@ class GenericBcdSizesView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::BcdView< + [[nodiscard]] typename ::emboss::prelude::BcdView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> one_byte() const; - ::emboss::support::Maybe has_one_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_one_byte() const; public: - typename ::emboss::prelude::BcdView< + [[nodiscard]] typename ::emboss::prelude::BcdView< /**/ ::emboss::support::FixedSizeViewParameters<16, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 16>> two_byte() const; - ::emboss::support::Maybe has_two_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_two_byte() const; public: - typename ::emboss::prelude::BcdView< + [[nodiscard]] typename ::emboss::prelude::BcdView< /**/ ::emboss::support::FixedSizeViewParameters<24, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 24>> three_byte() const; - ::emboss::support::Maybe has_three_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_three_byte() const; public: - typename ::emboss::prelude::BcdView< + [[nodiscard]] typename ::emboss::prelude::BcdView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> four_byte() const; - ::emboss::support::Maybe has_four_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_four_byte() const; public: - typename ::emboss::prelude::BcdView< + [[nodiscard]] typename ::emboss::prelude::BcdView< /**/ ::emboss::support::FixedSizeViewParameters<40, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 40>> five_byte() const; - ::emboss::support::Maybe has_five_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_five_byte() const; public: - typename ::emboss::prelude::BcdView< + [[nodiscard]] typename ::emboss::prelude::BcdView< /**/ ::emboss::support::FixedSizeViewParameters<48, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 48>> six_byte() const; - ::emboss::support::Maybe has_six_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_six_byte() const; public: - typename ::emboss::prelude::BcdView< + [[nodiscard]] typename ::emboss::prelude::BcdView< /**/ ::emboss::support::FixedSizeViewParameters<56, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 56>> seven_byte() const; - ::emboss::support::Maybe has_seven_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_seven_byte() const; public: - typename ::emboss::prelude::BcdView< + [[nodiscard]] typename ::emboss::prelude::BcdView< /**/ ::emboss::support::FixedSizeViewParameters<64, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 64>> eight_byte() const; - ::emboss::support::Maybe has_eight_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_eight_byte() const; private: - typename ::emboss::test::BcdSizes::GenericEmbossReservedAnonymousField1View>, 32>> + [[nodiscard]] typename ::emboss::test::BcdSizes::GenericEmbossReservedAnonymousField1View>, 32>> emboss_reserved_anonymous_field_1() const; - ::emboss::support::Maybe has_emboss_reserved_anonymous_field_1() const; + [[nodiscard]] ::emboss::support::Maybe has_emboss_reserved_anonymous_field_1() const; public: - auto four_bit() const -> decltype(this->emboss_reserved_anonymous_field_1().four_bit()) { + [[nodiscard]] auto four_bit() const -> decltype(this->emboss_reserved_anonymous_field_1().four_bit()) { return has_four_bit().ValueOrDefault() ? emboss_reserved_anonymous_field_1().four_bit() : decltype(this->emboss_reserved_anonymous_field_1().four_bit())(); } - ::emboss::support::Maybe has_four_bit() const; + [[nodiscard]] ::emboss::support::Maybe has_four_bit() const; public: - auto six_bit() const -> decltype(this->emboss_reserved_anonymous_field_1().six_bit()) { + [[nodiscard]] auto six_bit() const -> decltype(this->emboss_reserved_anonymous_field_1().six_bit()) { return has_six_bit().ValueOrDefault() ? emboss_reserved_anonymous_field_1().six_bit() : decltype(this->emboss_reserved_anonymous_field_1().six_bit())(); } - ::emboss::support::Maybe has_six_bit() const; + [[nodiscard]] ::emboss::support::Maybe has_six_bit() const; public: - auto ten_bit() const -> decltype(this->emboss_reserved_anonymous_field_1().ten_bit()) { + [[nodiscard]] auto ten_bit() const -> decltype(this->emboss_reserved_anonymous_field_1().ten_bit()) { return has_ten_bit().ValueOrDefault() ? emboss_reserved_anonymous_field_1().ten_bit() : decltype(this->emboss_reserved_anonymous_field_1().ten_bit())(); } - ::emboss::support::Maybe has_ten_bit() const; + [[nodiscard]] ::emboss::support::Maybe has_ten_bit() const; public: - auto twelve_bit() const -> decltype(this->emboss_reserved_anonymous_field_1().twelve_bit()) { + [[nodiscard]] auto twelve_bit() const -> decltype(this->emboss_reserved_anonymous_field_1().twelve_bit()) { return has_twelve_bit().ValueOrDefault() ? emboss_reserved_anonymous_field_1().twelve_bit() : decltype(this->emboss_reserved_anonymous_field_1().twelve_bit())(); } - ::emboss::support::Maybe has_twelve_bit() const; + [[nodiscard]] ::emboss::support::Maybe has_twelve_bit() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -1866,9 +1746,9 @@ class GenericBcdSizesView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1877,13 +1757,13 @@ class GenericBcdSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1901,9 +1781,9 @@ class GenericBcdSizesView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1912,13 +1792,13 @@ class GenericBcdSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1936,9 +1816,9 @@ class GenericBcdSizesView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1947,13 +1827,13 @@ class GenericBcdSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1984,7 +1864,7 @@ struct EmbossReservedInternalIsGenericBcdSizesView< }; template -inline GenericBcdSizesView< +[[nodiscard]] inline GenericBcdSizesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1999,7 +1879,7 @@ MakeBcdSizesView( T &&emboss_reserved_local_arg) { } template -inline GenericBcdSizesView> +[[nodiscard]] inline GenericBcdSizesView> MakeBcdSizesView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericBcdSizesView>( @@ -2008,7 +1888,7 @@ MakeBcdSizesView( T *emboss_reserved_local_data, } template -inline GenericBcdSizesView< +[[nodiscard]] inline GenericBcdSizesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedBcdSizesView( T *emboss_reserved_local_data, @@ -2073,58 +1953,40 @@ class GenericBcdBigEndianView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !four_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!four_byte().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericBcdBigEndianView emboss_reserved_local_other) const { if (!has_four_byte().Known()) return false; @@ -2145,7 +2007,7 @@ class GenericBcdBigEndianView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericBcdBigEndianView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_four_byte().ValueOr(false) && @@ -2178,7 +2040,7 @@ class GenericBcdBigEndianView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericBcdBigEndianView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -2273,15 +2135,15 @@ class GenericBcdBigEndianView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::BcdView< + [[nodiscard]] typename ::emboss::prelude::BcdView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> four_byte() const; - ::emboss::support::Maybe has_four_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_four_byte() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -2297,9 +2159,9 @@ class GenericBcdBigEndianView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2308,13 +2170,13 @@ class GenericBcdBigEndianView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2332,9 +2194,9 @@ class GenericBcdBigEndianView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2343,13 +2205,13 @@ class GenericBcdBigEndianView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2367,9 +2229,9 @@ class GenericBcdBigEndianView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2378,13 +2240,13 @@ class GenericBcdBigEndianView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2415,7 +2277,7 @@ struct EmbossReservedInternalIsGenericBcdBigEndianView< }; template -inline GenericBcdBigEndianView< +[[nodiscard]] inline GenericBcdBigEndianView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2430,7 +2292,7 @@ MakeBcdBigEndianView( T &&emboss_reserved_local_arg) { } template -inline GenericBcdBigEndianView> +[[nodiscard]] inline GenericBcdBigEndianView> MakeBcdBigEndianView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericBcdBigEndianView>( @@ -2439,7 +2301,7 @@ MakeBcdBigEndianView( T *emboss_reserved_local_data, } template -inline GenericBcdBigEndianView< +[[nodiscard]] inline GenericBcdBigEndianView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedBcdBigEndianView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/bits.emb.h b/testdata/golden_cpp/bits.emb.h index 1509726..1045e59 100644 --- a/testdata/golden_cpp/bits.emb.h +++ b/testdata/golden_cpp/bits.emb.h @@ -139,86 +139,44 @@ class GenericOneByteView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !high_bit().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !less_high_bit().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !mid_nibble().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !less_low_bit().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !low_bit().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!high_bit().Ok()) return false; + if (!less_high_bit().Ok()) return false; + if (!mid_nibble().Ok()) return false; + if (!less_low_bit().Ok()) return false; + if (!low_bit().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericOneByteView emboss_reserved_local_other) const { if (!has_high_bit().Known()) return false; @@ -307,7 +265,7 @@ class GenericOneByteView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericOneByteView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_high_bit().ValueOr(false) && @@ -396,7 +354,7 @@ class GenericOneByteView final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericOneByteView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -643,47 +601,47 @@ class GenericOneByteView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> high_bit() const; - ::emboss::support::Maybe has_high_bit() const; + [[nodiscard]] ::emboss::support::Maybe has_high_bit() const; public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> less_high_bit() const; - ::emboss::support::Maybe has_less_high_bit() const; + [[nodiscard]] ::emboss::support::Maybe has_less_high_bit() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<4, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> mid_nibble() const; - ::emboss::support::Maybe has_mid_nibble() const; + [[nodiscard]] ::emboss::support::Maybe has_mid_nibble() const; public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> less_low_bit() const; - ::emboss::support::Maybe has_less_low_bit() const; + [[nodiscard]] ::emboss::support::Maybe has_less_low_bit() const; public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> low_bit() const; - ::emboss::support::Maybe has_low_bit() const; + [[nodiscard]] ::emboss::support::Maybe has_low_bit() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -699,9 +657,9 @@ class GenericOneByteView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -710,13 +668,13 @@ class GenericOneByteView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -734,9 +692,9 @@ class GenericOneByteView final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -745,13 +703,13 @@ class GenericOneByteView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -769,9 +727,9 @@ class GenericOneByteView final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -780,13 +738,13 @@ class GenericOneByteView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -817,7 +775,7 @@ struct EmbossReservedInternalIsGenericOneByteView< }; template -inline GenericOneByteView< +[[nodiscard]] inline GenericOneByteView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -832,7 +790,7 @@ MakeOneByteView( T &&emboss_reserved_local_arg) { } template -inline GenericOneByteView> +[[nodiscard]] inline GenericOneByteView> MakeOneByteView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericOneByteView>( @@ -841,7 +799,7 @@ MakeOneByteView( T *emboss_reserved_local_data, } template -inline GenericOneByteView< +[[nodiscard]] inline GenericOneByteView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedOneByteView( T *emboss_reserved_local_data, @@ -929,72 +887,42 @@ class GenericTwoByteWithGapsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !high_bit().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !mid_nibble().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !low_bit().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!high_bit().Ok()) return false; + if (!mid_nibble().Ok()) return false; + if (!low_bit().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericTwoByteWithGapsView emboss_reserved_local_other) const { if (!has_high_bit().Known()) return false; @@ -1049,7 +977,7 @@ class GenericTwoByteWithGapsView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericTwoByteWithGapsView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_high_bit().ValueOr(false) && @@ -1110,7 +1038,7 @@ class GenericTwoByteWithGapsView final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericTwoByteWithGapsView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1281,31 +1209,31 @@ class GenericTwoByteWithGapsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> high_bit() const; - ::emboss::support::Maybe has_high_bit() const; + [[nodiscard]] ::emboss::support::Maybe has_high_bit() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<4, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> mid_nibble() const; - ::emboss::support::Maybe has_mid_nibble() const; + [[nodiscard]] ::emboss::support::Maybe has_mid_nibble() const; public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> low_bit() const; - ::emboss::support::Maybe has_low_bit() const; + [[nodiscard]] ::emboss::support::Maybe has_low_bit() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -1321,9 +1249,9 @@ class GenericTwoByteWithGapsView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1332,13 +1260,13 @@ class GenericTwoByteWithGapsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1356,9 +1284,9 @@ class GenericTwoByteWithGapsView final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1367,13 +1295,13 @@ class GenericTwoByteWithGapsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1391,9 +1319,9 @@ class GenericTwoByteWithGapsView final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1402,13 +1330,13 @@ class GenericTwoByteWithGapsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1439,7 +1367,7 @@ struct EmbossReservedInternalIsGenericTwoByteWithGapsView< }; template -inline GenericTwoByteWithGapsView< +[[nodiscard]] inline GenericTwoByteWithGapsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1454,7 +1382,7 @@ MakeTwoByteWithGapsView( T &&emboss_reserved_local_arg) { } template -inline GenericTwoByteWithGapsView> +[[nodiscard]] inline GenericTwoByteWithGapsView> MakeTwoByteWithGapsView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericTwoByteWithGapsView>( @@ -1463,7 +1391,7 @@ MakeTwoByteWithGapsView( T *emboss_reserved_local_data, } template -inline GenericTwoByteWithGapsView< +[[nodiscard]] inline GenericTwoByteWithGapsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedTwoByteWithGapsView( T *emboss_reserved_local_data, @@ -1524,86 +1452,44 @@ class GenericFourByteView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !high_nibble().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !two_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !raw_low_nibble().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !low_nibble().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!high_nibble().Ok()) return false; + if (!one_byte().Ok()) return false; + if (!two_byte().Ok()) return false; + if (!raw_low_nibble().Ok()) return false; + if (!low_nibble().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericFourByteView emboss_reserved_local_other) const { if (!has_high_nibble().Known()) return false; @@ -1675,7 +1561,7 @@ class GenericFourByteView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericFourByteView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_high_nibble().ValueOr(false) && @@ -1750,7 +1636,7 @@ class GenericFourByteView final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericFourByteView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1997,35 +1883,35 @@ class GenericFourByteView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<4, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> high_nibble() const; - ::emboss::support::Maybe has_high_nibble() const; + [[nodiscard]] ::emboss::support::Maybe has_high_nibble() const; public: - typename ::emboss::test::GenericOneByteView> + [[nodiscard]] typename ::emboss::test::GenericOneByteView> one_byte() const; - ::emboss::support::Maybe has_one_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_one_byte() const; public: - typename ::emboss::test::FourByte::GenericTwoByteWithGapsView> + [[nodiscard]] typename ::emboss::test::FourByte::GenericTwoByteWithGapsView> two_byte() const; - ::emboss::support::Maybe has_two_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_two_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<4, FourByte::EmbossReservedValidatorForRawLowNibble>, typename Storage::template OffsetStorageType> raw_low_nibble() const; - ::emboss::support::Maybe has_raw_low_nibble() const; + [[nodiscard]] ::emboss::support::Maybe has_raw_low_nibble() const; public: class EmbossReservedVirtualLowNibbleView final { @@ -2044,17 +1930,17 @@ class GenericFourByteView final { default; ~EmbossReservedVirtualLowNibbleView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_low_nibble().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -2067,9 +1953,9 @@ class GenericFourByteView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } - bool TryToWrite(::std::int32_t emboss_reserved_local_value) { + [[nodiscard]] bool TryToWrite(::std::int32_t emboss_reserved_local_value) { const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(100LL))); if (!CouldWriteValue(emboss_reserved_local_value)) return false; return view_.raw_low_nibble().TryToWrite( @@ -2083,7 +1969,7 @@ class GenericFourByteView final { void UncheckedWrite(::std::int32_t emboss_reserved_local_value) { view_.raw_low_nibble().UncheckedWrite((::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(100LL)))).ValueOrDefault()); } - bool CouldWriteValue(::std::int32_t emboss_reserved_local_value) { + [[nodiscard]] bool CouldWriteValue(::std::int32_t emboss_reserved_local_value) { if (!ValueIsOk(emboss_reserved_local_value)) return false; const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(100LL))); if (!emboss_reserved_local_maybe_new_value.Known()) return false; @@ -2099,7 +1985,7 @@ class GenericFourByteView final { private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.raw_low_nibble(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(100LL))); @@ -2107,7 +1993,7 @@ class GenericFourByteView final { return emboss_reserved_local_subexpr_3; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -2115,8 +2001,8 @@ class GenericFourByteView final { const GenericFourByteView view_; }; - EmbossReservedVirtualLowNibbleView low_nibble() const; - ::emboss::support::Maybe has_low_nibble() const; + [[nodiscard]] EmbossReservedVirtualLowNibbleView low_nibble() const; + [[nodiscard]] ::emboss::support::Maybe has_low_nibble() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -2132,9 +2018,9 @@ class GenericFourByteView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2143,13 +2029,13 @@ class GenericFourByteView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -2167,9 +2053,9 @@ class GenericFourByteView final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2178,13 +2064,13 @@ class GenericFourByteView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -2202,9 +2088,9 @@ class GenericFourByteView final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2213,13 +2099,13 @@ class GenericFourByteView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -2250,7 +2136,7 @@ struct EmbossReservedInternalIsGenericFourByteView< }; template -inline GenericFourByteView< +[[nodiscard]] inline GenericFourByteView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2265,7 +2151,7 @@ MakeFourByteView( T &&emboss_reserved_local_arg) { } template -inline GenericFourByteView> +[[nodiscard]] inline GenericFourByteView> MakeFourByteView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericFourByteView>( @@ -2274,7 +2160,7 @@ MakeFourByteView( T *emboss_reserved_local_data, } template -inline GenericFourByteView< +[[nodiscard]] inline GenericFourByteView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedFourByteView( T *emboss_reserved_local_data, @@ -2340,65 +2226,41 @@ class GenericArrayInBitsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !lone_flag().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !flags().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!lone_flag().Ok()) return false; + if (!flags().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericArrayInBitsView emboss_reserved_local_other) const { if (!has_lone_flag().Known()) return false; @@ -2436,7 +2298,7 @@ class GenericArrayInBitsView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericArrayInBitsView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_lone_flag().ValueOr(false) && @@ -2483,7 +2345,7 @@ class GenericArrayInBitsView final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericArrayInBitsView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -2616,18 +2478,18 @@ class GenericArrayInBitsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> lone_flag() const; - ::emboss::support::Maybe has_lone_flag() const; + [[nodiscard]] ::emboss::support::Maybe has_lone_flag() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType::template OffsetStorageType> @@ -2636,7 +2498,7 @@ class GenericArrayInBitsView final { 1 > flags() const; - ::emboss::support::Maybe has_flags() const; + [[nodiscard]] ::emboss::support::Maybe has_flags() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -2652,9 +2514,9 @@ class GenericArrayInBitsView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2663,13 +2525,13 @@ class GenericArrayInBitsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -2687,9 +2549,9 @@ class GenericArrayInBitsView final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2698,13 +2560,13 @@ class GenericArrayInBitsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -2722,9 +2584,9 @@ class GenericArrayInBitsView final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2733,13 +2595,13 @@ class GenericArrayInBitsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -2770,7 +2632,7 @@ struct EmbossReservedInternalIsGenericArrayInBitsView< }; template -inline GenericArrayInBitsView< +[[nodiscard]] inline GenericArrayInBitsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2785,7 +2647,7 @@ MakeArrayInBitsView( T &&emboss_reserved_local_arg) { } template -inline GenericArrayInBitsView> +[[nodiscard]] inline GenericArrayInBitsView> MakeArrayInBitsView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericArrayInBitsView>( @@ -2794,7 +2656,7 @@ MakeArrayInBitsView( T *emboss_reserved_local_data, } template -inline GenericArrayInBitsView< +[[nodiscard]] inline GenericArrayInBitsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedArrayInBitsView( T *emboss_reserved_local_data, @@ -2859,58 +2721,40 @@ class GenericArrayInBitsInStructView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !array_in_bits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!array_in_bits().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericArrayInBitsInStructView emboss_reserved_local_other) const { if (!has_array_in_bits().Known()) return false; @@ -2931,7 +2775,7 @@ class GenericArrayInBitsInStructView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericArrayInBitsInStructView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_array_in_bits().ValueOr(false) && @@ -2964,7 +2808,7 @@ class GenericArrayInBitsInStructView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericArrayInBitsInStructView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -3059,13 +2903,13 @@ class GenericArrayInBitsInStructView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::test::GenericArrayInBitsView>, 16>> + [[nodiscard]] typename ::emboss::test::GenericArrayInBitsView>, 16>> array_in_bits() const; - ::emboss::support::Maybe has_array_in_bits() const; + [[nodiscard]] ::emboss::support::Maybe has_array_in_bits() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -3081,9 +2925,9 @@ class GenericArrayInBitsInStructView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3092,13 +2936,13 @@ class GenericArrayInBitsInStructView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3116,9 +2960,9 @@ class GenericArrayInBitsInStructView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3127,13 +2971,13 @@ class GenericArrayInBitsInStructView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3151,9 +2995,9 @@ class GenericArrayInBitsInStructView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3162,13 +3006,13 @@ class GenericArrayInBitsInStructView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3199,7 +3043,7 @@ struct EmbossReservedInternalIsGenericArrayInBitsInStructView< }; template -inline GenericArrayInBitsInStructView< +[[nodiscard]] inline GenericArrayInBitsInStructView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3214,7 +3058,7 @@ MakeArrayInBitsInStructView( T &&emboss_reserved_local_arg) { } template -inline GenericArrayInBitsInStructView> +[[nodiscard]] inline GenericArrayInBitsInStructView> MakeArrayInBitsInStructView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericArrayInBitsInStructView>( @@ -3223,7 +3067,7 @@ MakeArrayInBitsInStructView( T *emboss_reserved_local_data, } template -inline GenericArrayInBitsInStructView< +[[nodiscard]] inline GenericArrayInBitsInStructView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedArrayInBitsInStructView( T *emboss_reserved_local_data, @@ -3291,78 +3135,42 @@ class GenericStructOfBitsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !two_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !four_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !located_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!one_byte().Ok()) return false; + if (!two_byte().Ok()) return false; + if (!four_byte().Ok()) return false; + if (!located_byte().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericStructOfBitsView emboss_reserved_local_other) const { if (!has_one_byte().Known()) return false; @@ -3434,7 +3242,7 @@ class GenericStructOfBitsView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericStructOfBitsView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_one_byte().ValueOr(false) && @@ -3509,7 +3317,7 @@ class GenericStructOfBitsView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericStructOfBitsView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -3718,33 +3526,33 @@ class GenericStructOfBitsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::test::GenericOneByteView>, 8>> + [[nodiscard]] typename ::emboss::test::GenericOneByteView>, 8>> one_byte() const; - ::emboss::support::Maybe has_one_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_one_byte() const; public: - typename ::emboss::test::FourByte::GenericTwoByteWithGapsView>, 16>> + [[nodiscard]] typename ::emboss::test::FourByte::GenericTwoByteWithGapsView>, 16>> two_byte() const; - ::emboss::support::Maybe has_two_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_two_byte() const; public: - typename ::emboss::test::GenericFourByteView>, 32>> + [[nodiscard]] typename ::emboss::test::GenericFourByteView>, 32>> four_byte() const; - ::emboss::support::Maybe has_four_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_four_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> located_byte() const; - ::emboss::support::Maybe has_located_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_located_byte() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -3763,17 +3571,17 @@ class GenericStructOfBitsView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -3786,12 +3594,12 @@ class GenericStructOfBitsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.one_byte().mid_nibble(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(1LL))); @@ -3801,7 +3609,7 @@ class GenericStructOfBitsView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -3809,8 +3617,8 @@ class GenericStructOfBitsView final { const GenericStructOfBitsView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -3826,9 +3634,9 @@ class GenericStructOfBitsView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3837,13 +3645,13 @@ class GenericStructOfBitsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3861,9 +3669,9 @@ class GenericStructOfBitsView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3872,13 +3680,13 @@ class GenericStructOfBitsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3909,7 +3717,7 @@ struct EmbossReservedInternalIsGenericStructOfBitsView< }; template -inline GenericStructOfBitsView< +[[nodiscard]] inline GenericStructOfBitsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3924,7 +3732,7 @@ MakeStructOfBitsView( T &&emboss_reserved_local_arg) { } template -inline GenericStructOfBitsView> +[[nodiscard]] inline GenericStructOfBitsView> MakeStructOfBitsView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericStructOfBitsView>( @@ -3933,7 +3741,7 @@ MakeStructOfBitsView( T *emboss_reserved_local_data, } template -inline GenericStructOfBitsView< +[[nodiscard]] inline GenericStructOfBitsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructOfBitsView( T *emboss_reserved_local_data, @@ -3998,58 +3806,40 @@ class GenericBitArrayView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!one_byte().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericBitArrayView emboss_reserved_local_other) const { if (!has_one_byte().Known()) return false; @@ -4070,7 +3860,7 @@ class GenericBitArrayView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericBitArrayView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_one_byte().ValueOr(false) && @@ -4103,7 +3893,7 @@ class GenericBitArrayView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericBitArrayView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -4198,17 +3988,17 @@ class GenericBitArrayView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::test::GenericOneByteView::template OffsetStorageType>, 8>> , typename Storage::template OffsetStorageType, 1, 8 > one_byte() const; - ::emboss::support::Maybe has_one_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_one_byte() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -4224,9 +4014,9 @@ class GenericBitArrayView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4235,13 +4025,13 @@ class GenericBitArrayView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4259,9 +4049,9 @@ class GenericBitArrayView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4270,13 +4060,13 @@ class GenericBitArrayView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4294,9 +4084,9 @@ class GenericBitArrayView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4305,13 +4095,13 @@ class GenericBitArrayView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4342,7 +4132,7 @@ struct EmbossReservedInternalIsGenericBitArrayView< }; template -inline GenericBitArrayView< +[[nodiscard]] inline GenericBitArrayView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4357,7 +4147,7 @@ MakeBitArrayView( T &&emboss_reserved_local_arg) { } template -inline GenericBitArrayView> +[[nodiscard]] inline GenericBitArrayView> MakeBitArrayView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericBitArrayView>( @@ -4366,7 +4156,7 @@ MakeBitArrayView( T *emboss_reserved_local_data, } template -inline GenericBitArrayView< +[[nodiscard]] inline GenericBitArrayView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedBitArrayView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/complex_offset.emb.h b/testdata/golden_cpp/complex_offset.emb.h index e478bf3..eff386c 100644 --- a/testdata/golden_cpp/complex_offset.emb.h +++ b/testdata/golden_cpp/complex_offset.emb.h @@ -103,58 +103,40 @@ class GenericLengthView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !length().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!length().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericLengthView emboss_reserved_local_other) const { if (!has_length().Known()) return false; @@ -175,7 +157,7 @@ class GenericLengthView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericLengthView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_length().ValueOr(false) && @@ -208,7 +190,7 @@ class GenericLengthView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericLengthView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -303,15 +285,15 @@ class GenericLengthView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> length() const; - ::emboss::support::Maybe has_length() const; + [[nodiscard]] ::emboss::support::Maybe has_length() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -327,9 +309,9 @@ class GenericLengthView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -338,13 +320,13 @@ class GenericLengthView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -362,9 +344,9 @@ class GenericLengthView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -373,13 +355,13 @@ class GenericLengthView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -397,9 +379,9 @@ class GenericLengthView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -408,13 +390,13 @@ class GenericLengthView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -445,7 +427,7 @@ struct EmbossReservedInternalIsGenericLengthView< }; template -inline GenericLengthView< +[[nodiscard]] inline GenericLengthView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -460,7 +442,7 @@ MakeLengthView( T &&emboss_reserved_local_arg) { } template -inline GenericLengthView> +[[nodiscard]] inline GenericLengthView> MakeLengthView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericLengthView>( @@ -469,7 +451,7 @@ MakeLengthView( T *emboss_reserved_local_data, } template -inline GenericLengthView< +[[nodiscard]] inline GenericLengthView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedLengthView( T *emboss_reserved_local_data, @@ -535,64 +517,40 @@ class GenericDataView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !length().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !data().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!length().Ok()) return false; + if (!data().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericDataView emboss_reserved_local_other) const { if (!has_length().Known()) return false; @@ -630,7 +588,7 @@ class GenericDataView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericDataView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_length().ValueOr(false) && @@ -677,7 +635,7 @@ class GenericDataView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericDataView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -810,16 +768,16 @@ class GenericDataView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::test::GenericLengthView> + [[nodiscard]] typename ::emboss::test::GenericLengthView> length() const; - ::emboss::support::Maybe has_length() const; + [[nodiscard]] ::emboss::support::Maybe has_length() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 8>> @@ -828,7 +786,7 @@ class GenericDataView final { 8 > data() const; - ::emboss::support::Maybe has_data() const; + [[nodiscard]] ::emboss::support::Maybe has_data() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -847,17 +805,17 @@ class GenericDataView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -870,12 +828,12 @@ class GenericDataView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.length().length(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(::emboss::support::Maybe(static_cast(1LL)), emboss_reserved_local_subexpr_2); @@ -885,7 +843,7 @@ class GenericDataView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -893,8 +851,8 @@ class GenericDataView final { const GenericDataView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -910,9 +868,9 @@ class GenericDataView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -921,13 +879,13 @@ class GenericDataView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -945,9 +903,9 @@ class GenericDataView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -956,13 +914,13 @@ class GenericDataView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -993,7 +951,7 @@ struct EmbossReservedInternalIsGenericDataView< }; template -inline GenericDataView< +[[nodiscard]] inline GenericDataView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1008,7 +966,7 @@ MakeDataView( T &&emboss_reserved_local_arg) { } template -inline GenericDataView> +[[nodiscard]] inline GenericDataView> MakeDataView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericDataView>( @@ -1017,7 +975,7 @@ MakeDataView( T *emboss_reserved_local_data, } template -inline GenericDataView< +[[nodiscard]] inline GenericDataView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedDataView( T *emboss_reserved_local_data, @@ -1098,169 +1056,55 @@ class GenericPackedFieldsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !length1().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !data1().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !o1().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !length2().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !data2().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !o2().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !length3().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !data3().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !o3().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !length4().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !data4().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !o4().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !length5().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !data5().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !o5().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !length6().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !data6().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!length1().Ok()) return false; + if (!data1().Ok()) return false; + if (!o1().Ok()) return false; + if (!length2().Ok()) return false; + if (!data2().Ok()) return false; + if (!o2().Ok()) return false; + if (!length3().Ok()) return false; + if (!data3().Ok()) return false; + if (!o3().Ok()) return false; + if (!length4().Ok()) return false; + if (!data4().Ok()) return false; + if (!o4().Ok()) return false; + if (!length5().Ok()) return false; + if (!data5().Ok()) return false; + if (!o5().Ok()) return false; + if (!length6().Ok()) return false; + if (!data6().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericPackedFieldsView emboss_reserved_local_other) const { if (!has_length1().Known()) return false; @@ -1468,7 +1312,7 @@ class GenericPackedFieldsView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericPackedFieldsView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_length1().ValueOr(false) && @@ -1655,7 +1499,7 @@ class GenericPackedFieldsView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericPackedFieldsView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -2263,19 +2107,19 @@ class GenericPackedFieldsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::test::GenericLengthView> + [[nodiscard]] typename ::emboss::test::GenericLengthView> length1() const; - ::emboss::support::Maybe has_length1() const; + [[nodiscard]] ::emboss::support::Maybe has_length1() const; public: - typename ::emboss::test::GenericDataView> + [[nodiscard]] typename ::emboss::test::GenericDataView> data1() const; - ::emboss::support::Maybe has_data1() const; + [[nodiscard]] ::emboss::support::Maybe has_data1() const; public: class EmbossReservedVirtualO1View final { @@ -2294,17 +2138,17 @@ class GenericPackedFieldsView final { default; ~EmbossReservedVirtualO1View() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_o1().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -2317,19 +2161,19 @@ class GenericPackedFieldsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.data1().IntrinsicSizeInBytes(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); return emboss_reserved_local_subexpr_2; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -2337,20 +2181,20 @@ class GenericPackedFieldsView final { const GenericPackedFieldsView view_; }; - EmbossReservedVirtualO1View o1() const; - ::emboss::support::Maybe has_o1() const; + [[nodiscard]] EmbossReservedVirtualO1View o1() const; + [[nodiscard]] ::emboss::support::Maybe has_o1() const; public: - typename ::emboss::test::GenericLengthView> + [[nodiscard]] typename ::emboss::test::GenericLengthView> length2() const; - ::emboss::support::Maybe has_length2() const; + [[nodiscard]] ::emboss::support::Maybe has_length2() const; public: - typename ::emboss::test::GenericDataView> + [[nodiscard]] typename ::emboss::test::GenericDataView> data2() const; - ::emboss::support::Maybe has_data2() const; + [[nodiscard]] ::emboss::support::Maybe has_data2() const; public: class EmbossReservedVirtualO2View final { @@ -2369,17 +2213,17 @@ class GenericPackedFieldsView final { default; ~EmbossReservedVirtualO2View() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_o2().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -2392,12 +2236,12 @@ class GenericPackedFieldsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.o1(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = view_.data2().IntrinsicSizeInBytes(); @@ -2407,7 +2251,7 @@ class GenericPackedFieldsView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -2415,20 +2259,20 @@ class GenericPackedFieldsView final { const GenericPackedFieldsView view_; }; - EmbossReservedVirtualO2View o2() const; - ::emboss::support::Maybe has_o2() const; + [[nodiscard]] EmbossReservedVirtualO2View o2() const; + [[nodiscard]] ::emboss::support::Maybe has_o2() const; public: - typename ::emboss::test::GenericLengthView> + [[nodiscard]] typename ::emboss::test::GenericLengthView> length3() const; - ::emboss::support::Maybe has_length3() const; + [[nodiscard]] ::emboss::support::Maybe has_length3() const; public: - typename ::emboss::test::GenericDataView> + [[nodiscard]] typename ::emboss::test::GenericDataView> data3() const; - ::emboss::support::Maybe has_data3() const; + [[nodiscard]] ::emboss::support::Maybe has_data3() const; public: class EmbossReservedVirtualO3View final { @@ -2447,17 +2291,17 @@ class GenericPackedFieldsView final { default; ~EmbossReservedVirtualO3View() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_o3().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -2470,12 +2314,12 @@ class GenericPackedFieldsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.o2(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = view_.data3().IntrinsicSizeInBytes(); @@ -2485,7 +2329,7 @@ class GenericPackedFieldsView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -2493,20 +2337,20 @@ class GenericPackedFieldsView final { const GenericPackedFieldsView view_; }; - EmbossReservedVirtualO3View o3() const; - ::emboss::support::Maybe has_o3() const; + [[nodiscard]] EmbossReservedVirtualO3View o3() const; + [[nodiscard]] ::emboss::support::Maybe has_o3() const; public: - typename ::emboss::test::GenericLengthView> + [[nodiscard]] typename ::emboss::test::GenericLengthView> length4() const; - ::emboss::support::Maybe has_length4() const; + [[nodiscard]] ::emboss::support::Maybe has_length4() const; public: - typename ::emboss::test::GenericDataView> + [[nodiscard]] typename ::emboss::test::GenericDataView> data4() const; - ::emboss::support::Maybe has_data4() const; + [[nodiscard]] ::emboss::support::Maybe has_data4() const; public: class EmbossReservedVirtualO4View final { @@ -2525,17 +2369,17 @@ class GenericPackedFieldsView final { default; ~EmbossReservedVirtualO4View() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_o4().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -2548,12 +2392,12 @@ class GenericPackedFieldsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.o3(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = view_.data4().IntrinsicSizeInBytes(); @@ -2563,7 +2407,7 @@ class GenericPackedFieldsView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -2571,20 +2415,20 @@ class GenericPackedFieldsView final { const GenericPackedFieldsView view_; }; - EmbossReservedVirtualO4View o4() const; - ::emboss::support::Maybe has_o4() const; + [[nodiscard]] EmbossReservedVirtualO4View o4() const; + [[nodiscard]] ::emboss::support::Maybe has_o4() const; public: - typename ::emboss::test::GenericLengthView> + [[nodiscard]] typename ::emboss::test::GenericLengthView> length5() const; - ::emboss::support::Maybe has_length5() const; + [[nodiscard]] ::emboss::support::Maybe has_length5() const; public: - typename ::emboss::test::GenericDataView> + [[nodiscard]] typename ::emboss::test::GenericDataView> data5() const; - ::emboss::support::Maybe has_data5() const; + [[nodiscard]] ::emboss::support::Maybe has_data5() const; public: class EmbossReservedVirtualO5View final { @@ -2603,17 +2447,17 @@ class GenericPackedFieldsView final { default; ~EmbossReservedVirtualO5View() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_o5().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -2626,12 +2470,12 @@ class GenericPackedFieldsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.o4(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = view_.data5().IntrinsicSizeInBytes(); @@ -2641,7 +2485,7 @@ class GenericPackedFieldsView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -2649,20 +2493,20 @@ class GenericPackedFieldsView final { const GenericPackedFieldsView view_; }; - EmbossReservedVirtualO5View o5() const; - ::emboss::support::Maybe has_o5() const; + [[nodiscard]] EmbossReservedVirtualO5View o5() const; + [[nodiscard]] ::emboss::support::Maybe has_o5() const; public: - typename ::emboss::test::GenericLengthView> + [[nodiscard]] typename ::emboss::test::GenericLengthView> length6() const; - ::emboss::support::Maybe has_length6() const; + [[nodiscard]] ::emboss::support::Maybe has_length6() const; public: - typename ::emboss::test::GenericDataView> + [[nodiscard]] typename ::emboss::test::GenericDataView> data6() const; - ::emboss::support::Maybe has_data6() const; + [[nodiscard]] ::emboss::support::Maybe has_data6() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -2681,17 +2525,17 @@ class GenericPackedFieldsView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -2704,12 +2548,12 @@ class GenericPackedFieldsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.length1().length(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(1LL))); @@ -2765,7 +2609,7 @@ class GenericPackedFieldsView final { return emboss_reserved_local_subexpr_51; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -2773,8 +2617,8 @@ class GenericPackedFieldsView final { const GenericPackedFieldsView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -2790,9 +2634,9 @@ class GenericPackedFieldsView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2801,13 +2645,13 @@ class GenericPackedFieldsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2825,9 +2669,9 @@ class GenericPackedFieldsView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2836,13 +2680,13 @@ class GenericPackedFieldsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2873,7 +2717,7 @@ struct EmbossReservedInternalIsGenericPackedFieldsView< }; template -inline GenericPackedFieldsView< +[[nodiscard]] inline GenericPackedFieldsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2888,7 +2732,7 @@ MakePackedFieldsView( T &&emboss_reserved_local_arg) { } template -inline GenericPackedFieldsView> +[[nodiscard]] inline GenericPackedFieldsView> MakePackedFieldsView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericPackedFieldsView>( @@ -2897,7 +2741,7 @@ MakePackedFieldsView( T *emboss_reserved_local_data, } template -inline GenericPackedFieldsView< +[[nodiscard]] inline GenericPackedFieldsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedPackedFieldsView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/complex_structure.emb.h b/testdata/golden_cpp/complex_structure.emb.h index 2ea9495..39af2e7 100644 --- a/testdata/golden_cpp/complex_structure.emb.h +++ b/testdata/golden_cpp/complex_structure.emb.h @@ -112,72 +112,42 @@ class GenericRegisterLayoutView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !l().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !h().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!l().Ok()) return false; + if (!h().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericRegisterLayoutView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -232,7 +202,7 @@ class GenericRegisterLayoutView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericRegisterLayoutView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -293,7 +263,7 @@ class GenericRegisterLayoutView final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericRegisterLayoutView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -464,31 +434,31 @@ class GenericRegisterLayoutView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::IntView< + [[nodiscard]] typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<4, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> l() const; - ::emboss::support::Maybe has_l() const; + [[nodiscard]] ::emboss::support::Maybe has_l() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<4, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> h() const; - ::emboss::support::Maybe has_h() const; + [[nodiscard]] ::emboss::support::Maybe has_h() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -504,9 +474,9 @@ class GenericRegisterLayoutView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -515,13 +485,13 @@ class GenericRegisterLayoutView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -539,9 +509,9 @@ class GenericRegisterLayoutView final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -550,13 +520,13 @@ class GenericRegisterLayoutView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -574,9 +544,9 @@ class GenericRegisterLayoutView final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -585,13 +555,13 @@ class GenericRegisterLayoutView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -622,7 +592,7 @@ struct EmbossReservedInternalIsGenericRegisterLayoutView< }; template -inline GenericRegisterLayoutView< +[[nodiscard]] inline GenericRegisterLayoutView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -637,7 +607,7 @@ MakeRegisterLayoutView( T &&emboss_reserved_local_arg) { } template -inline GenericRegisterLayoutView> +[[nodiscard]] inline GenericRegisterLayoutView> MakeRegisterLayoutView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericRegisterLayoutView>( @@ -646,7 +616,7 @@ MakeRegisterLayoutView( T *emboss_reserved_local_data, } template -inline GenericRegisterLayoutView< +[[nodiscard]] inline GenericRegisterLayoutView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedRegisterLayoutView( T *emboss_reserved_local_data, @@ -711,58 +681,40 @@ class GenericArrayElementView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericArrayElementView emboss_reserved_local_other) const { if (!has_a().Known()) return false; @@ -783,7 +735,7 @@ class GenericArrayElementView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericArrayElementView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_a().ValueOr(false) && @@ -816,7 +768,7 @@ class GenericArrayElementView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericArrayElementView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -911,13 +863,13 @@ class GenericArrayElementView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss_test::GenericRegisterLayoutView>, 8>> + [[nodiscard]] typename ::emboss_test::GenericRegisterLayoutView>, 8>> a() const; - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -933,9 +885,9 @@ class GenericArrayElementView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -944,13 +896,13 @@ class GenericArrayElementView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -968,9 +920,9 @@ class GenericArrayElementView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -979,13 +931,13 @@ class GenericArrayElementView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1003,9 +955,9 @@ class GenericArrayElementView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1014,13 +966,13 @@ class GenericArrayElementView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1051,7 +1003,7 @@ struct EmbossReservedInternalIsGenericArrayElementView< }; template -inline GenericArrayElementView< +[[nodiscard]] inline GenericArrayElementView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1066,7 +1018,7 @@ MakeArrayElementView( T &&emboss_reserved_local_arg) { } template -inline GenericArrayElementView> +[[nodiscard]] inline GenericArrayElementView> MakeArrayElementView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericArrayElementView>( @@ -1075,7 +1027,7 @@ MakeArrayElementView( T *emboss_reserved_local_data, } template -inline GenericArrayElementView< +[[nodiscard]] inline GenericArrayElementView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedArrayElementView( T *emboss_reserved_local_data, @@ -1163,79 +1115,43 @@ class GenericEmbossReservedAnonymousField1View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a0().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !s0().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !l0().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !h0().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a0().Ok()) return false; + if (!s0().Ok()) return false; + if (!l0().Ok()) return false; + if (!h0().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { if (!has_a0().Known()) return false; @@ -1307,7 +1223,7 @@ class GenericEmbossReservedAnonymousField1View final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_a0().ValueOr(false) && @@ -1382,7 +1298,7 @@ class GenericEmbossReservedAnonymousField1View final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1591,39 +1507,39 @@ class GenericEmbossReservedAnonymousField1View final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> a0() const; - ::emboss::support::Maybe has_a0() const; + [[nodiscard]] ::emboss::support::Maybe has_a0() const; public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> s0() const; - ::emboss::support::Maybe has_s0() const; + [[nodiscard]] ::emboss::support::Maybe has_s0() const; public: - typename ::emboss::prelude::IntView< + [[nodiscard]] typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<4, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> l0() const; - ::emboss::support::Maybe has_l0() const; + [[nodiscard]] ::emboss::support::Maybe has_l0() const; public: - typename ::emboss::prelude::IntView< + [[nodiscard]] typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<4, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> h0() const; - ::emboss::support::Maybe has_h0() const; + [[nodiscard]] ::emboss::support::Maybe has_h0() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -1639,9 +1555,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1650,13 +1566,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1674,9 +1590,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1685,13 +1601,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1709,9 +1625,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1720,13 +1636,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1757,7 +1673,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField1View< }; template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1772,7 +1688,7 @@ MakeEmbossReservedAnonymousField1View( T &&emboss_reserved_local_arg) { } template -inline GenericEmbossReservedAnonymousField1View> +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View> MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericEmbossReservedAnonymousField1View>( @@ -1781,7 +1697,7 @@ MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, @@ -1842,173 +1758,123 @@ class GenericComplexView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); - const auto emboss_reserved_local_ok_subexpr_2 = a0(); - const auto emboss_reserved_local_ok_subexpr_3 = b2(); - const auto emboss_reserved_local_ok_subexpr_4 = s(); - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !s().Ok()) return false; - } - + const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); + const auto emboss_reserved_local_ok_subexpr_2 = a0(); + const auto emboss_reserved_local_ok_subexpr_3 = (emboss_reserved_local_ok_subexpr_2.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_2.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_4 = ::emboss::support::GreaterThanOrEqual(emboss_reserved_local_ok_subexpr_3, ::emboss::support::Maybe(static_cast(128LL))); + const auto emboss_reserved_local_ok_subexpr_5 = ::emboss::support::LessThan(emboss_reserved_local_ok_subexpr_3, ::emboss::support::Maybe(static_cast(128LL))); + const auto emboss_reserved_local_ok_subexpr_6 = b2(); + const auto emboss_reserved_local_ok_subexpr_7 = (emboss_reserved_local_ok_subexpr_6.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_6.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_8 = ::emboss::support::GreaterThan(emboss_reserved_local_ok_subexpr_7, ::emboss::support::Maybe(static_cast(25LL))); + const auto emboss_reserved_local_ok_subexpr_9 = s(); + const auto emboss_reserved_local_ok_subexpr_10 = (emboss_reserved_local_ok_subexpr_9.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_9.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_11 = ::emboss::support::GreaterThanOrEqual(emboss_reserved_local_ok_subexpr_10, ::emboss::support::Maybe(static_cast(4LL))); + const auto emboss_reserved_local_ok_subexpr_12 = ::emboss::support::GreaterThanOrEqual(emboss_reserved_local_ok_subexpr_3, ::emboss::support::Maybe(static_cast(80LL))); + const auto emboss_reserved_local_ok_subexpr_13 = e3(); + const auto emboss_reserved_local_ok_subexpr_14 = (emboss_reserved_local_ok_subexpr_13.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_13.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_15 = ::emboss::support::GreaterThanOrEqual(emboss_reserved_local_ok_subexpr_14, ::emboss::support::Maybe(static_cast(128LL))); + const auto emboss_reserved_local_ok_subexpr_16 = ::emboss::support::LessThan(emboss_reserved_local_ok_subexpr_7, ::emboss::support::Maybe(static_cast(50LL))); + const auto emboss_reserved_local_ok_subexpr_17 = ::emboss::support::Choice(emboss_reserved_local_ok_subexpr_12, emboss_reserved_local_ok_subexpr_15, emboss_reserved_local_ok_subexpr_16); + const auto emboss_reserved_local_ok_subexpr_18 = ::emboss::support::And(emboss_reserved_local_ok_subexpr_11, emboss_reserved_local_ok_subexpr_17); + const auto emboss_reserved_local_ok_subexpr_19 = ::emboss::support::GreaterThanOrEqual(emboss_reserved_local_ok_subexpr_10, ::emboss::support::Maybe(static_cast(5LL))); + const auto emboss_reserved_local_ok_subexpr_20 = e4(); + const auto emboss_reserved_local_ok_subexpr_21 = (emboss_reserved_local_ok_subexpr_20.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_20.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_22 = ::emboss::support::GreaterThan(emboss_reserved_local_ok_subexpr_21, ::emboss::support::Maybe(static_cast(0LL))); + const auto emboss_reserved_local_ok_subexpr_23 = ::emboss::support::And(emboss_reserved_local_ok_subexpr_19, emboss_reserved_local_ok_subexpr_22); + const auto emboss_reserved_local_ok_subexpr_24 = ::emboss::support::LessThan(emboss_reserved_local_ok_subexpr_10, ::emboss::support::Maybe(static_cast(2LL))); + const auto emboss_reserved_local_ok_subexpr_25 = ::emboss::support::LessThan(emboss_reserved_local_ok_subexpr_3, ::emboss::support::Maybe(static_cast(4LL))); + const auto emboss_reserved_local_ok_subexpr_26 = ::emboss::support::Or(emboss_reserved_local_ok_subexpr_24, emboss_reserved_local_ok_subexpr_25); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !u().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !i().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a0().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !s0().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !l0().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !h0().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !e1().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThanOrEqual((emboss_reserved_local_ok_subexpr_2.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_2.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(128LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !e2().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::LessThan((emboss_reserved_local_ok_subexpr_2.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_2.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(128LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b2().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!s().Ok()) return false; + if (!u().Ok()) return false; + if (!i().Ok()) return false; + if (!b().Ok()) return false; + if (!a().Ok()) return false; + if (!emboss_reserved_anonymous_field_1().Ok()) return false; + if (!e1().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThan((emboss_reserved_local_ok_subexpr_3.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_3.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(25LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !e3().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a0().Ok()) return false; + if (!s0().Ok()) return false; + if (!l0().Ok()) return false; + if (!h0().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::GreaterThanOrEqual((emboss_reserved_local_ok_subexpr_4.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_4.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(4LL))), ::emboss::support::Choice(::emboss::support::GreaterThanOrEqual((emboss_reserved_local_ok_subexpr_2.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_2.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(80LL))), ::emboss::support::GreaterThanOrEqual((e3().Ok() ? ::emboss::support::Maybe(static_cast(e3().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(128LL))), ::emboss::support::LessThan((emboss_reserved_local_ok_subexpr_3.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_3.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(50LL))))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !e4().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_4; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!e2().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::GreaterThanOrEqual((emboss_reserved_local_ok_subexpr_4.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_4.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(5LL))), ::emboss::support::GreaterThan((e4().Ok() ? ::emboss::support::Maybe(static_cast(e4().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL)))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !e5().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_5; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!b2().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Or(::emboss::support::LessThan((emboss_reserved_local_ok_subexpr_4.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_4.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(2LL))), ::emboss::support::LessThan((emboss_reserved_local_ok_subexpr_2.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_2.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(4LL)))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !e0().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_8; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!e3().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_18; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!e4().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_23; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!e5().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_26; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!e0().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericComplexView emboss_reserved_local_other) const { if (!has_s().Known()) return false; @@ -2233,7 +2099,7 @@ class GenericComplexView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericComplexView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_s().ValueOr(false) && @@ -2434,7 +2300,7 @@ class GenericComplexView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericComplexView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -3099,42 +2965,42 @@ class GenericComplexView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> s() const; - ::emboss::support::Maybe has_s() const; + [[nodiscard]] ::emboss::support::Maybe has_s() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<64, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 64>> u() const; - ::emboss::support::Maybe has_u() const; + [[nodiscard]] ::emboss::support::Maybe has_u() const; public: - typename ::emboss::prelude::IntView< + [[nodiscard]] typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<64, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 64>> i() const; - ::emboss::support::Maybe has_i() const; + [[nodiscard]] ::emboss::support::Maybe has_i() const; public: - typename ::emboss::prelude::BcdView< + [[nodiscard]] typename ::emboss::prelude::BcdView< /**/ ::emboss::support::FixedSizeViewParameters<64, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 64>> b() const; - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::support::GenericArrayView< typename ::emboss_test::GenericArrayElementView::template OffsetStorageType::template OffsetStorageType> @@ -3145,93 +3011,93 @@ class GenericComplexView final { 8 > a() const; - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; private: - typename ::emboss_test::Complex::GenericEmbossReservedAnonymousField1View>, 8>> + [[nodiscard]] typename ::emboss_test::Complex::GenericEmbossReservedAnonymousField1View>, 8>> emboss_reserved_anonymous_field_1() const; - ::emboss::support::Maybe has_emboss_reserved_anonymous_field_1() const; + [[nodiscard]] ::emboss::support::Maybe has_emboss_reserved_anonymous_field_1() const; public: - auto a0() const -> decltype(this->emboss_reserved_anonymous_field_1().a0()) { + [[nodiscard]] auto a0() const -> decltype(this->emboss_reserved_anonymous_field_1().a0()) { return has_a0().ValueOrDefault() ? emboss_reserved_anonymous_field_1().a0() : decltype(this->emboss_reserved_anonymous_field_1().a0())(); } - ::emboss::support::Maybe has_a0() const; + [[nodiscard]] ::emboss::support::Maybe has_a0() const; public: - auto s0() const -> decltype(this->emboss_reserved_anonymous_field_1().s0()) { + [[nodiscard]] auto s0() const -> decltype(this->emboss_reserved_anonymous_field_1().s0()) { return has_s0().ValueOrDefault() ? emboss_reserved_anonymous_field_1().s0() : decltype(this->emboss_reserved_anonymous_field_1().s0())(); } - ::emboss::support::Maybe has_s0() const; + [[nodiscard]] ::emboss::support::Maybe has_s0() const; public: - auto l0() const -> decltype(this->emboss_reserved_anonymous_field_1().l0()) { + [[nodiscard]] auto l0() const -> decltype(this->emboss_reserved_anonymous_field_1().l0()) { return has_l0().ValueOrDefault() ? emboss_reserved_anonymous_field_1().l0() : decltype(this->emboss_reserved_anonymous_field_1().l0())(); } - ::emboss::support::Maybe has_l0() const; + [[nodiscard]] ::emboss::support::Maybe has_l0() const; public: - auto h0() const -> decltype(this->emboss_reserved_anonymous_field_1().h0()) { + [[nodiscard]] auto h0() const -> decltype(this->emboss_reserved_anonymous_field_1().h0()) { return has_h0().ValueOrDefault() ? emboss_reserved_anonymous_field_1().h0() : decltype(this->emboss_reserved_anonymous_field_1().h0())(); } - ::emboss::support::Maybe has_h0() const; + [[nodiscard]] ::emboss::support::Maybe has_h0() const; public: - typename ::emboss_test::GenericArrayElementView> + [[nodiscard]] typename ::emboss_test::GenericArrayElementView> e1() const; - ::emboss::support::Maybe has_e1() const; + [[nodiscard]] ::emboss::support::Maybe has_e1() const; public: - typename ::emboss_test::GenericArrayElementView> + [[nodiscard]] typename ::emboss_test::GenericArrayElementView> e2() const; - ::emboss::support::Maybe has_e2() const; + [[nodiscard]] ::emboss::support::Maybe has_e2() const; public: - typename ::emboss::prelude::BcdView< + [[nodiscard]] typename ::emboss::prelude::BcdView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> b2() const; - ::emboss::support::Maybe has_b2() const; + [[nodiscard]] ::emboss::support::Maybe has_b2() const; public: - typename ::emboss::prelude::IntView< + [[nodiscard]] typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> e3() const; - ::emboss::support::Maybe has_e3() const; + [[nodiscard]] ::emboss::support::Maybe has_e3() const; public: - typename ::emboss::prelude::IntView< + [[nodiscard]] typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> e4() const; - ::emboss::support::Maybe has_e4() const; + [[nodiscard]] ::emboss::support::Maybe has_e4() const; public: - typename ::emboss::prelude::IntView< + [[nodiscard]] typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> e5() const; - ::emboss::support::Maybe has_e5() const; + [[nodiscard]] ::emboss::support::Maybe has_e5() const; public: - typename ::emboss::prelude::IntView< + [[nodiscard]] typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> e0() const; - ::emboss::support::Maybe has_e0() const; + [[nodiscard]] ::emboss::support::Maybe has_e0() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -3250,17 +3116,17 @@ class GenericComplexView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -3273,12 +3139,12 @@ class GenericComplexView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.s(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Product(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(4LL))); @@ -3318,7 +3184,7 @@ class GenericComplexView final { return emboss_reserved_local_subexpr_35; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -3326,8 +3192,8 @@ class GenericComplexView final { const GenericComplexView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -3343,9 +3209,9 @@ class GenericComplexView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3354,13 +3220,13 @@ class GenericComplexView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3378,9 +3244,9 @@ class GenericComplexView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3389,13 +3255,13 @@ class GenericComplexView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3426,7 +3292,7 @@ struct EmbossReservedInternalIsGenericComplexView< }; template -inline GenericComplexView< +[[nodiscard]] inline GenericComplexView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3441,7 +3307,7 @@ MakeComplexView( T &&emboss_reserved_local_arg) { } template -inline GenericComplexView> +[[nodiscard]] inline GenericComplexView> MakeComplexView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericComplexView>( @@ -3450,7 +3316,7 @@ MakeComplexView( T *emboss_reserved_local_data, } template -inline GenericComplexView< +[[nodiscard]] inline GenericComplexView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedComplexView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/condition.emb.h b/testdata/golden_cpp/condition.emb.h index 1ba3f50..0fb69e8 100644 --- a/testdata/golden_cpp/condition.emb.h +++ b/testdata/golden_cpp/condition.emb.h @@ -357,64 +357,50 @@ class GenericBasicConditionalView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_switch_discrim = emboss_reserved_local_ok_subexpr_2; + if (!emboss_reserved_switch_discrim.Known()) return false; + switch (emboss_reserved_switch_discrim.ValueOrDefault()) { + case static_cast(0LL): + if (!xc().Ok()) return false; + break; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericBasicConditionalView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -452,7 +438,7 @@ class GenericBasicConditionalView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericBasicConditionalView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -499,7 +485,7 @@ class GenericBasicConditionalView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericBasicConditionalView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -632,23 +618,23 @@ class GenericBasicConditionalView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -667,17 +653,17 @@ class GenericBasicConditionalView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -690,12 +676,12 @@ class GenericBasicConditionalView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(0LL))); @@ -705,7 +691,7 @@ class GenericBasicConditionalView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -713,8 +699,8 @@ class GenericBasicConditionalView final { const GenericBasicConditionalView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -730,9 +716,9 @@ class GenericBasicConditionalView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -741,13 +727,13 @@ class GenericBasicConditionalView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -765,9 +751,9 @@ class GenericBasicConditionalView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -776,13 +762,13 @@ class GenericBasicConditionalView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -813,7 +799,7 @@ struct EmbossReservedInternalIsGenericBasicConditionalView< }; template -inline GenericBasicConditionalView< +[[nodiscard]] inline GenericBasicConditionalView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -828,7 +814,7 @@ MakeBasicConditionalView( T &&emboss_reserved_local_arg) { } template -inline GenericBasicConditionalView> +[[nodiscard]] inline GenericBasicConditionalView> MakeBasicConditionalView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericBasicConditionalView>( @@ -837,7 +823,7 @@ MakeBasicConditionalView( T *emboss_reserved_local_data, } template -inline GenericBasicConditionalView< +[[nodiscard]] inline GenericBasicConditionalView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedBasicConditionalView( T *emboss_reserved_local_data, @@ -903,64 +889,49 @@ class GenericNegativeConditionalView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::NotEqual(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(0LL))); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::NotEqual((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_3; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!xc().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericNegativeConditionalView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -998,7 +969,7 @@ class GenericNegativeConditionalView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericNegativeConditionalView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -1045,7 +1016,7 @@ class GenericNegativeConditionalView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericNegativeConditionalView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1178,23 +1149,23 @@ class GenericNegativeConditionalView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -1213,17 +1184,17 @@ class GenericNegativeConditionalView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -1236,12 +1207,12 @@ class GenericNegativeConditionalView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::NotEqual(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(0LL))); @@ -1251,7 +1222,7 @@ class GenericNegativeConditionalView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -1259,8 +1230,8 @@ class GenericNegativeConditionalView final { const GenericNegativeConditionalView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -1276,9 +1247,9 @@ class GenericNegativeConditionalView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1287,13 +1258,13 @@ class GenericNegativeConditionalView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1311,9 +1282,9 @@ class GenericNegativeConditionalView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1322,13 +1293,13 @@ class GenericNegativeConditionalView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1359,7 +1330,7 @@ struct EmbossReservedInternalIsGenericNegativeConditionalView< }; template -inline GenericNegativeConditionalView< +[[nodiscard]] inline GenericNegativeConditionalView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1374,7 +1345,7 @@ MakeNegativeConditionalView( T &&emboss_reserved_local_arg) { } template -inline GenericNegativeConditionalView> +[[nodiscard]] inline GenericNegativeConditionalView> MakeNegativeConditionalView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericNegativeConditionalView>( @@ -1383,7 +1354,7 @@ MakeNegativeConditionalView( T *emboss_reserved_local_data, } template -inline GenericNegativeConditionalView< +[[nodiscard]] inline GenericNegativeConditionalView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedNegativeConditionalView( T *emboss_reserved_local_data, @@ -1450,72 +1421,52 @@ class GenericConditionalAndUnconditionalOverlappingFinalFieldView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !z().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!z().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_switch_discrim = emboss_reserved_local_ok_subexpr_2; + if (!emboss_reserved_switch_discrim.Known()) return false; + switch (emboss_reserved_switch_discrim.ValueOrDefault()) { + case static_cast(0LL): + if (!xc().Ok()) return false; + break; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericConditionalAndUnconditionalOverlappingFinalFieldView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -1570,7 +1521,7 @@ class GenericConditionalAndUnconditionalOverlappingFinalFieldView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericConditionalAndUnconditionalOverlappingFinalFieldView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -1631,7 +1582,7 @@ class GenericConditionalAndUnconditionalOverlappingFinalFieldView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericConditionalAndUnconditionalOverlappingFinalFieldView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1802,31 +1753,31 @@ class GenericConditionalAndUnconditionalOverlappingFinalFieldView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> z() const; - ::emboss::support::Maybe has_z() const; + [[nodiscard]] ::emboss::support::Maybe has_z() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -1842,9 +1793,9 @@ class GenericConditionalAndUnconditionalOverlappingFinalFieldView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1853,13 +1804,13 @@ class GenericConditionalAndUnconditionalOverlappingFinalFieldView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1877,9 +1828,9 @@ class GenericConditionalAndUnconditionalOverlappingFinalFieldView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1888,13 +1839,13 @@ class GenericConditionalAndUnconditionalOverlappingFinalFieldView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1912,9 +1863,9 @@ class GenericConditionalAndUnconditionalOverlappingFinalFieldView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1923,13 +1874,13 @@ class GenericConditionalAndUnconditionalOverlappingFinalFieldView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1960,7 +1911,7 @@ struct EmbossReservedInternalIsGenericConditionalAndUnconditionalOverlappingFina }; template -inline GenericConditionalAndUnconditionalOverlappingFinalFieldView< +[[nodiscard]] inline GenericConditionalAndUnconditionalOverlappingFinalFieldView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1975,7 +1926,7 @@ MakeConditionalAndUnconditionalOverlappingFinalFieldView( T &&emboss_reserved_lo } template -inline GenericConditionalAndUnconditionalOverlappingFinalFieldView> +[[nodiscard]] inline GenericConditionalAndUnconditionalOverlappingFinalFieldView> MakeConditionalAndUnconditionalOverlappingFinalFieldView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericConditionalAndUnconditionalOverlappingFinalFieldView>( @@ -1984,7 +1935,7 @@ MakeConditionalAndUnconditionalOverlappingFinalFieldView( T *emboss_reserved_loc } template -inline GenericConditionalAndUnconditionalOverlappingFinalFieldView< +[[nodiscard]] inline GenericConditionalAndUnconditionalOverlappingFinalFieldView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConditionalAndUnconditionalOverlappingFinalFieldView( T *emboss_reserved_local_data, @@ -2050,65 +2001,51 @@ class GenericConditionalBasicConditionalFieldFirstView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_switch_discrim = emboss_reserved_local_ok_subexpr_2; + if (!emboss_reserved_switch_discrim.Known()) return false; + switch (emboss_reserved_switch_discrim.ValueOrDefault()) { + case static_cast(0LL): + if (!xc().Ok()) return false; + break; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericConditionalBasicConditionalFieldFirstView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -2146,7 +2083,7 @@ class GenericConditionalBasicConditionalFieldFirstView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericConditionalBasicConditionalFieldFirstView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -2193,7 +2130,7 @@ class GenericConditionalBasicConditionalFieldFirstView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericConditionalBasicConditionalFieldFirstView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -2326,23 +2263,23 @@ class GenericConditionalBasicConditionalFieldFirstView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -2358,9 +2295,9 @@ class GenericConditionalBasicConditionalFieldFirstView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2369,13 +2306,13 @@ class GenericConditionalBasicConditionalFieldFirstView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2393,9 +2330,9 @@ class GenericConditionalBasicConditionalFieldFirstView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2404,13 +2341,13 @@ class GenericConditionalBasicConditionalFieldFirstView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2428,9 +2365,9 @@ class GenericConditionalBasicConditionalFieldFirstView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2439,13 +2376,13 @@ class GenericConditionalBasicConditionalFieldFirstView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2476,7 +2413,7 @@ struct EmbossReservedInternalIsGenericConditionalBasicConditionalFieldFirstView< }; template -inline GenericConditionalBasicConditionalFieldFirstView< +[[nodiscard]] inline GenericConditionalBasicConditionalFieldFirstView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2491,7 +2428,7 @@ MakeConditionalBasicConditionalFieldFirstView( T &&emboss_reserved_local_arg) { } template -inline GenericConditionalBasicConditionalFieldFirstView> +[[nodiscard]] inline GenericConditionalBasicConditionalFieldFirstView> MakeConditionalBasicConditionalFieldFirstView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericConditionalBasicConditionalFieldFirstView>( @@ -2500,7 +2437,7 @@ MakeConditionalBasicConditionalFieldFirstView( T *emboss_reserved_local_data, } template -inline GenericConditionalBasicConditionalFieldFirstView< +[[nodiscard]] inline GenericConditionalBasicConditionalFieldFirstView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConditionalBasicConditionalFieldFirstView( T *emboss_reserved_local_data, @@ -2567,71 +2504,51 @@ class GenericConditionalAndDynamicLocationView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!y().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_switch_discrim = emboss_reserved_local_ok_subexpr_2; + if (!emboss_reserved_switch_discrim.Known()) return false; + switch (emboss_reserved_switch_discrim.ValueOrDefault()) { + case static_cast(0LL): + if (!xc().Ok()) return false; + break; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericConditionalAndDynamicLocationView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -2686,7 +2603,7 @@ class GenericConditionalAndDynamicLocationView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericConditionalAndDynamicLocationView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -2747,7 +2664,7 @@ class GenericConditionalAndDynamicLocationView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericConditionalAndDynamicLocationView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -2918,31 +2835,31 @@ class GenericConditionalAndDynamicLocationView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> y() const; - ::emboss::support::Maybe has_y() const; + [[nodiscard]] ::emboss::support::Maybe has_y() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -2961,17 +2878,17 @@ class GenericConditionalAndDynamicLocationView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -2984,12 +2901,12 @@ class GenericConditionalAndDynamicLocationView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(0LL))); @@ -3002,7 +2919,7 @@ class GenericConditionalAndDynamicLocationView final { return emboss_reserved_local_subexpr_8; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -3010,8 +2927,8 @@ class GenericConditionalAndDynamicLocationView final { const GenericConditionalAndDynamicLocationView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -3027,9 +2944,9 @@ class GenericConditionalAndDynamicLocationView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3038,13 +2955,13 @@ class GenericConditionalAndDynamicLocationView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3062,9 +2979,9 @@ class GenericConditionalAndDynamicLocationView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3073,13 +2990,13 @@ class GenericConditionalAndDynamicLocationView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3110,7 +3027,7 @@ struct EmbossReservedInternalIsGenericConditionalAndDynamicLocationView< }; template -inline GenericConditionalAndDynamicLocationView< +[[nodiscard]] inline GenericConditionalAndDynamicLocationView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3125,7 +3042,7 @@ MakeConditionalAndDynamicLocationView( T &&emboss_reserved_local_arg) { } template -inline GenericConditionalAndDynamicLocationView> +[[nodiscard]] inline GenericConditionalAndDynamicLocationView> MakeConditionalAndDynamicLocationView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericConditionalAndDynamicLocationView>( @@ -3134,7 +3051,7 @@ MakeConditionalAndDynamicLocationView( T *emboss_reserved_local_data, } template -inline GenericConditionalAndDynamicLocationView< +[[nodiscard]] inline GenericConditionalAndDynamicLocationView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConditionalAndDynamicLocationView( T *emboss_reserved_local_data, @@ -3200,64 +3117,51 @@ class GenericConditionUsesMinIntView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::Difference(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(9223372036854775680LL))); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal(::emboss::support::Difference((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(9223372036854775680LL))), ::emboss::support::Maybe(static_cast(-9223372036854775807LL - 1))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_switch_discrim = emboss_reserved_local_ok_subexpr_3; + if (!emboss_reserved_switch_discrim.Known()) return false; + switch (emboss_reserved_switch_discrim.ValueOrDefault()) { + case static_cast(-9223372036854775807LL - 1): + if (!xc().Ok()) return false; + break; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericConditionUsesMinIntView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -3295,7 +3199,7 @@ class GenericConditionUsesMinIntView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericConditionUsesMinIntView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -3342,7 +3246,7 @@ class GenericConditionUsesMinIntView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericConditionUsesMinIntView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -3475,23 +3379,23 @@ class GenericConditionUsesMinIntView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::IntView< + [[nodiscard]] typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -3510,17 +3414,17 @@ class GenericConditionUsesMinIntView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -3533,12 +3437,12 @@ class GenericConditionUsesMinIntView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Difference(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(9223372036854775680LL))); @@ -3549,7 +3453,7 @@ class GenericConditionUsesMinIntView final { return emboss_reserved_local_subexpr_6; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -3557,8 +3461,8 @@ class GenericConditionUsesMinIntView final { const GenericConditionUsesMinIntView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -3574,9 +3478,9 @@ class GenericConditionUsesMinIntView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3585,13 +3489,13 @@ class GenericConditionUsesMinIntView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3609,9 +3513,9 @@ class GenericConditionUsesMinIntView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3620,13 +3524,13 @@ class GenericConditionUsesMinIntView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3657,7 +3561,7 @@ struct EmbossReservedInternalIsGenericConditionUsesMinIntView< }; template -inline GenericConditionUsesMinIntView< +[[nodiscard]] inline GenericConditionUsesMinIntView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3672,7 +3576,7 @@ MakeConditionUsesMinIntView( T &&emboss_reserved_local_arg) { } template -inline GenericConditionUsesMinIntView> +[[nodiscard]] inline GenericConditionUsesMinIntView> MakeConditionUsesMinIntView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericConditionUsesMinIntView>( @@ -3681,7 +3585,7 @@ MakeConditionUsesMinIntView( T *emboss_reserved_local_data, } template -inline GenericConditionUsesMinIntView< +[[nodiscard]] inline GenericConditionUsesMinIntView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConditionUsesMinIntView( T *emboss_reserved_local_data, @@ -3748,71 +3652,61 @@ class GenericNestedConditionalView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = xc(); + const auto emboss_reserved_local_ok_subexpr_4 = (emboss_reserved_local_ok_subexpr_3.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_3.UncheckedRead())) : ::emboss::support::Maybe()); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal((xc().Ok() ? ::emboss::support::Maybe(static_cast(xc().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xcc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_switch_discrim = emboss_reserved_local_ok_subexpr_2; + if (!emboss_reserved_switch_discrim.Known()) return false; + switch (emboss_reserved_switch_discrim.ValueOrDefault()) { + case static_cast(0LL): + if (!xc().Ok()) return false; + break; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_switch_discrim = emboss_reserved_local_ok_subexpr_4; + if (!emboss_reserved_switch_discrim.Known()) return false; + switch (emboss_reserved_switch_discrim.ValueOrDefault()) { + case static_cast(0LL): + if (!xcc().Ok()) return false; + break; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericNestedConditionalView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -3867,7 +3761,7 @@ class GenericNestedConditionalView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericNestedConditionalView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -3928,7 +3822,7 @@ class GenericNestedConditionalView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericNestedConditionalView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -4099,31 +3993,31 @@ class GenericNestedConditionalView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xcc() const; - ::emboss::support::Maybe has_xcc() const; + [[nodiscard]] ::emboss::support::Maybe has_xcc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -4142,17 +4036,17 @@ class GenericNestedConditionalView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -4165,12 +4059,12 @@ class GenericNestedConditionalView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(0LL))); @@ -4184,7 +4078,7 @@ class GenericNestedConditionalView final { return emboss_reserved_local_subexpr_9; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -4192,8 +4086,8 @@ class GenericNestedConditionalView final { const GenericNestedConditionalView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -4209,9 +4103,9 @@ class GenericNestedConditionalView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4220,13 +4114,13 @@ class GenericNestedConditionalView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4244,9 +4138,9 @@ class GenericNestedConditionalView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4255,13 +4149,13 @@ class GenericNestedConditionalView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4292,7 +4186,7 @@ struct EmbossReservedInternalIsGenericNestedConditionalView< }; template -inline GenericNestedConditionalView< +[[nodiscard]] inline GenericNestedConditionalView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4307,7 +4201,7 @@ MakeNestedConditionalView( T &&emboss_reserved_local_arg) { } template -inline GenericNestedConditionalView> +[[nodiscard]] inline GenericNestedConditionalView> MakeNestedConditionalView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericNestedConditionalView>( @@ -4316,7 +4210,7 @@ MakeNestedConditionalView( T *emboss_reserved_local_data, } template -inline GenericNestedConditionalView< +[[nodiscard]] inline GenericNestedConditionalView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedNestedConditionalView( T *emboss_reserved_local_data, @@ -4383,72 +4277,62 @@ class GenericCorrectNestedConditionalView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - const auto emboss_reserved_local_ok_subexpr_1 = x(); - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))), ::emboss::support::Equal((xc().Ok() ? ::emboss::support::Maybe(static_cast(xc().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL)))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xcc().Ok()) return false; - } - + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(0LL))); + const auto emboss_reserved_local_ok_subexpr_4 = xc(); + const auto emboss_reserved_local_ok_subexpr_5 = (emboss_reserved_local_ok_subexpr_4.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_4.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_6 = ::emboss::support::Equal(emboss_reserved_local_ok_subexpr_5, ::emboss::support::Maybe(static_cast(0LL))); + const auto emboss_reserved_local_ok_subexpr_7 = ::emboss::support::And(emboss_reserved_local_ok_subexpr_3, emboss_reserved_local_ok_subexpr_6); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_switch_discrim = emboss_reserved_local_ok_subexpr_2; + if (!emboss_reserved_switch_discrim.Known()) return false; + switch (emboss_reserved_switch_discrim.ValueOrDefault()) { + case static_cast(0LL): + if (!xc().Ok()) return false; + break; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_7; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!xcc().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericCorrectNestedConditionalView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -4503,7 +4387,7 @@ class GenericCorrectNestedConditionalView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericCorrectNestedConditionalView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -4564,7 +4448,7 @@ class GenericCorrectNestedConditionalView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericCorrectNestedConditionalView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -4735,31 +4619,31 @@ class GenericCorrectNestedConditionalView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xcc() const; - ::emboss::support::Maybe has_xcc() const; + [[nodiscard]] ::emboss::support::Maybe has_xcc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -4778,17 +4662,17 @@ class GenericCorrectNestedConditionalView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -4801,12 +4685,12 @@ class GenericCorrectNestedConditionalView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(0LL))); @@ -4821,7 +4705,7 @@ class GenericCorrectNestedConditionalView final { return emboss_reserved_local_subexpr_10; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -4829,8 +4713,8 @@ class GenericCorrectNestedConditionalView final { const GenericCorrectNestedConditionalView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -4846,9 +4730,9 @@ class GenericCorrectNestedConditionalView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4857,13 +4741,13 @@ class GenericCorrectNestedConditionalView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4881,9 +4765,9 @@ class GenericCorrectNestedConditionalView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4892,13 +4776,13 @@ class GenericCorrectNestedConditionalView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4929,7 +4813,7 @@ struct EmbossReservedInternalIsGenericCorrectNestedConditionalView< }; template -inline GenericCorrectNestedConditionalView< +[[nodiscard]] inline GenericCorrectNestedConditionalView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4944,7 +4828,7 @@ MakeCorrectNestedConditionalView( T &&emboss_reserved_local_arg) { } template -inline GenericCorrectNestedConditionalView> +[[nodiscard]] inline GenericCorrectNestedConditionalView> MakeCorrectNestedConditionalView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericCorrectNestedConditionalView>( @@ -4953,7 +4837,7 @@ MakeCorrectNestedConditionalView( T *emboss_reserved_local_data, } template -inline GenericCorrectNestedConditionalView< +[[nodiscard]] inline GenericCorrectNestedConditionalView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedCorrectNestedConditionalView( T *emboss_reserved_local_data, @@ -5019,65 +4903,47 @@ class GenericAlwaysFalseConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(false); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(false); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!xc().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericAlwaysFalseConditionView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -5115,7 +4981,7 @@ class GenericAlwaysFalseConditionView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericAlwaysFalseConditionView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -5162,7 +5028,7 @@ class GenericAlwaysFalseConditionView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericAlwaysFalseConditionView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -5295,23 +5161,23 @@ class GenericAlwaysFalseConditionView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -5327,9 +5193,9 @@ class GenericAlwaysFalseConditionView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5338,13 +5204,13 @@ class GenericAlwaysFalseConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5362,9 +5228,9 @@ class GenericAlwaysFalseConditionView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5373,13 +5239,13 @@ class GenericAlwaysFalseConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5397,9 +5263,9 @@ class GenericAlwaysFalseConditionView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5408,13 +5274,13 @@ class GenericAlwaysFalseConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5445,7 +5311,7 @@ struct EmbossReservedInternalIsGenericAlwaysFalseConditionView< }; template -inline GenericAlwaysFalseConditionView< +[[nodiscard]] inline GenericAlwaysFalseConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5460,7 +5326,7 @@ MakeAlwaysFalseConditionView( T &&emboss_reserved_local_arg) { } template -inline GenericAlwaysFalseConditionView> +[[nodiscard]] inline GenericAlwaysFalseConditionView> MakeAlwaysFalseConditionView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericAlwaysFalseConditionView>( @@ -5469,7 +5335,7 @@ MakeAlwaysFalseConditionView( T *emboss_reserved_local_data, } template -inline GenericAlwaysFalseConditionView< +[[nodiscard]] inline GenericAlwaysFalseConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedAlwaysFalseConditionView( T *emboss_reserved_local_data, @@ -5534,58 +5400,46 @@ class GenericOnlyAlwaysFalseConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(false); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(false); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!xc().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericOnlyAlwaysFalseConditionView emboss_reserved_local_other) const { if (!has_xc().Known()) return false; @@ -5606,7 +5460,7 @@ class GenericOnlyAlwaysFalseConditionView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericOnlyAlwaysFalseConditionView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_xc().ValueOr(false) && @@ -5639,7 +5493,7 @@ class GenericOnlyAlwaysFalseConditionView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericOnlyAlwaysFalseConditionView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -5734,15 +5588,15 @@ class GenericOnlyAlwaysFalseConditionView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -5758,9 +5612,9 @@ class GenericOnlyAlwaysFalseConditionView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5769,13 +5623,13 @@ class GenericOnlyAlwaysFalseConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5793,9 +5647,9 @@ class GenericOnlyAlwaysFalseConditionView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5804,13 +5658,13 @@ class GenericOnlyAlwaysFalseConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5828,9 +5682,9 @@ class GenericOnlyAlwaysFalseConditionView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5839,13 +5693,13 @@ class GenericOnlyAlwaysFalseConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5876,7 +5730,7 @@ struct EmbossReservedInternalIsGenericOnlyAlwaysFalseConditionView< }; template -inline GenericOnlyAlwaysFalseConditionView< +[[nodiscard]] inline GenericOnlyAlwaysFalseConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5891,7 +5745,7 @@ MakeOnlyAlwaysFalseConditionView( T &&emboss_reserved_local_arg) { } template -inline GenericOnlyAlwaysFalseConditionView> +[[nodiscard]] inline GenericOnlyAlwaysFalseConditionView> MakeOnlyAlwaysFalseConditionView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericOnlyAlwaysFalseConditionView>( @@ -5900,7 +5754,7 @@ MakeOnlyAlwaysFalseConditionView( T *emboss_reserved_local_data, } template -inline GenericOnlyAlwaysFalseConditionView< +[[nodiscard]] inline GenericOnlyAlwaysFalseConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedOnlyAlwaysFalseConditionView( T *emboss_reserved_local_data, @@ -5964,56 +5818,44 @@ class GenericEmptyStructView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericEmptyStructView emboss_reserved_local_other) const { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericEmptyStructView emboss_reserved_local_other) const { return true; } @@ -6033,7 +5875,7 @@ class GenericEmptyStructView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericEmptyStructView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -6092,7 +5934,7 @@ class GenericEmptyStructView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -6108,9 +5950,9 @@ class GenericEmptyStructView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6119,13 +5961,13 @@ class GenericEmptyStructView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -6143,9 +5985,9 @@ class GenericEmptyStructView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6154,13 +5996,13 @@ class GenericEmptyStructView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -6178,9 +6020,9 @@ class GenericEmptyStructView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6189,13 +6031,13 @@ class GenericEmptyStructView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -6226,7 +6068,7 @@ struct EmbossReservedInternalIsGenericEmptyStructView< }; template -inline GenericEmptyStructView< +[[nodiscard]] inline GenericEmptyStructView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -6241,7 +6083,7 @@ MakeEmptyStructView( T &&emboss_reserved_local_arg) { } template -inline GenericEmptyStructView> +[[nodiscard]] inline GenericEmptyStructView> MakeEmptyStructView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericEmptyStructView>( @@ -6250,7 +6092,7 @@ MakeEmptyStructView( T *emboss_reserved_local_data, } template -inline GenericEmptyStructView< +[[nodiscard]] inline GenericEmptyStructView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmptyStructView( T *emboss_reserved_local_data, @@ -6317,71 +6159,47 @@ class GenericAlwaysFalseConditionDynamicSizeView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(false); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!y().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(false); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!xc().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericAlwaysFalseConditionDynamicSizeView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -6436,7 +6254,7 @@ class GenericAlwaysFalseConditionDynamicSizeView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericAlwaysFalseConditionDynamicSizeView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -6497,7 +6315,7 @@ class GenericAlwaysFalseConditionDynamicSizeView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericAlwaysFalseConditionDynamicSizeView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -6668,31 +6486,31 @@ class GenericAlwaysFalseConditionDynamicSizeView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> y() const; - ::emboss::support::Maybe has_y() const; + [[nodiscard]] ::emboss::support::Maybe has_y() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -6711,17 +6529,17 @@ class GenericAlwaysFalseConditionDynamicSizeView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -6734,12 +6552,12 @@ class GenericAlwaysFalseConditionDynamicSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(1LL))); @@ -6749,7 +6567,7 @@ class GenericAlwaysFalseConditionDynamicSizeView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -6757,8 +6575,8 @@ class GenericAlwaysFalseConditionDynamicSizeView final { const GenericAlwaysFalseConditionDynamicSizeView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -6774,9 +6592,9 @@ class GenericAlwaysFalseConditionDynamicSizeView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6785,13 +6603,13 @@ class GenericAlwaysFalseConditionDynamicSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -6809,9 +6627,9 @@ class GenericAlwaysFalseConditionDynamicSizeView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6820,13 +6638,13 @@ class GenericAlwaysFalseConditionDynamicSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -6857,7 +6675,7 @@ struct EmbossReservedInternalIsGenericAlwaysFalseConditionDynamicSizeView< }; template -inline GenericAlwaysFalseConditionDynamicSizeView< +[[nodiscard]] inline GenericAlwaysFalseConditionDynamicSizeView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -6872,7 +6690,7 @@ MakeAlwaysFalseConditionDynamicSizeView( T &&emboss_reserved_local_arg) { } template -inline GenericAlwaysFalseConditionDynamicSizeView> +[[nodiscard]] inline GenericAlwaysFalseConditionDynamicSizeView> MakeAlwaysFalseConditionDynamicSizeView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericAlwaysFalseConditionDynamicSizeView>( @@ -6881,7 +6699,7 @@ MakeAlwaysFalseConditionDynamicSizeView( T *emboss_reserved_local_data, } template -inline GenericAlwaysFalseConditionDynamicSizeView< +[[nodiscard]] inline GenericAlwaysFalseConditionDynamicSizeView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedAlwaysFalseConditionDynamicSizeView( T *emboss_reserved_local_data, @@ -6948,72 +6766,52 @@ class GenericConditionDoesNotContributeToSizeView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!y().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_switch_discrim = emboss_reserved_local_ok_subexpr_2; + if (!emboss_reserved_switch_discrim.Known()) return false; + switch (emboss_reserved_switch_discrim.ValueOrDefault()) { + case static_cast(0LL): + if (!xc().Ok()) return false; + break; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericConditionDoesNotContributeToSizeView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -7068,7 +6866,7 @@ class GenericConditionDoesNotContributeToSizeView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericConditionDoesNotContributeToSizeView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -7129,7 +6927,7 @@ class GenericConditionDoesNotContributeToSizeView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericConditionDoesNotContributeToSizeView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -7300,31 +7098,31 @@ class GenericConditionDoesNotContributeToSizeView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> y() const; - ::emboss::support::Maybe has_y() const; + [[nodiscard]] ::emboss::support::Maybe has_y() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -7340,9 +7138,9 @@ class GenericConditionDoesNotContributeToSizeView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -7351,13 +7149,13 @@ class GenericConditionDoesNotContributeToSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -7375,9 +7173,9 @@ class GenericConditionDoesNotContributeToSizeView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -7386,13 +7184,13 @@ class GenericConditionDoesNotContributeToSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -7410,9 +7208,9 @@ class GenericConditionDoesNotContributeToSizeView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -7421,13 +7219,13 @@ class GenericConditionDoesNotContributeToSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -7458,7 +7256,7 @@ struct EmbossReservedInternalIsGenericConditionDoesNotContributeToSizeView< }; template -inline GenericConditionDoesNotContributeToSizeView< +[[nodiscard]] inline GenericConditionDoesNotContributeToSizeView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -7473,7 +7271,7 @@ MakeConditionDoesNotContributeToSizeView( T &&emboss_reserved_local_arg) { } template -inline GenericConditionDoesNotContributeToSizeView> +[[nodiscard]] inline GenericConditionDoesNotContributeToSizeView> MakeConditionDoesNotContributeToSizeView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericConditionDoesNotContributeToSizeView>( @@ -7482,7 +7280,7 @@ MakeConditionDoesNotContributeToSizeView( T *emboss_reserved_local_data, } template -inline GenericConditionDoesNotContributeToSizeView< +[[nodiscard]] inline GenericConditionDoesNotContributeToSizeView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConditionDoesNotContributeToSizeView( T *emboss_reserved_local_data, @@ -7636,72 +7434,58 @@ class GenericEnumConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - const auto emboss_reserved_local_ok_subexpr_1 = x(); - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::GreaterThan(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(0))); { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(1))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThan((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc2().Ok()) return false; + const auto emboss_reserved_switch_discrim = emboss_reserved_local_ok_subexpr_2; + if (!emboss_reserved_switch_discrim.Known()) return false; + switch (emboss_reserved_switch_discrim.ValueOrDefault()) { + case static_cast(1): + if (!xc().Ok()) return false; + break; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_3; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!xc2().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; - } - - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericEnumConditionView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -7756,7 +7540,7 @@ class GenericEnumConditionView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericEnumConditionView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -7817,7 +7601,7 @@ class GenericEnumConditionView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericEnumConditionView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -7988,32 +7772,32 @@ class GenericEnumConditionView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::OnOff, ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc2() const; - ::emboss::support::Maybe has_xc2() const; + [[nodiscard]] ::emboss::support::Maybe has_xc2() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -8032,17 +7816,17 @@ class GenericEnumConditionView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -8055,12 +7839,12 @@ class GenericEnumConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(1))); @@ -8072,7 +7856,7 @@ class GenericEnumConditionView final { return emboss_reserved_local_subexpr_7; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -8080,8 +7864,8 @@ class GenericEnumConditionView final { const GenericEnumConditionView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -8097,9 +7881,9 @@ class GenericEnumConditionView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -8108,13 +7892,13 @@ class GenericEnumConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -8132,9 +7916,9 @@ class GenericEnumConditionView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -8143,13 +7927,13 @@ class GenericEnumConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -8180,7 +7964,7 @@ struct EmbossReservedInternalIsGenericEnumConditionView< }; template -inline GenericEnumConditionView< +[[nodiscard]] inline GenericEnumConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -8195,7 +7979,7 @@ MakeEnumConditionView( T &&emboss_reserved_local_arg) { } template -inline GenericEnumConditionView> +[[nodiscard]] inline GenericEnumConditionView> MakeEnumConditionView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericEnumConditionView>( @@ -8204,7 +7988,7 @@ MakeEnumConditionView( T *emboss_reserved_local_data, } template -inline GenericEnumConditionView< +[[nodiscard]] inline GenericEnumConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEnumConditionView( T *emboss_reserved_local_data, @@ -8270,64 +8054,49 @@ class GenericNegativeEnumConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::NotEqual(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(1))); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::NotEqual((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(1))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_3; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!xc().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericNegativeEnumConditionView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -8365,7 +8134,7 @@ class GenericNegativeEnumConditionView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericNegativeEnumConditionView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -8412,7 +8181,7 @@ class GenericNegativeEnumConditionView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericNegativeEnumConditionView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -8545,24 +8314,24 @@ class GenericNegativeEnumConditionView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::OnOff, ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -8581,17 +8350,17 @@ class GenericNegativeEnumConditionView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -8604,12 +8373,12 @@ class GenericNegativeEnumConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::NotEqual(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(1))); @@ -8619,7 +8388,7 @@ class GenericNegativeEnumConditionView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -8627,8 +8396,8 @@ class GenericNegativeEnumConditionView final { const GenericNegativeEnumConditionView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -8644,9 +8413,9 @@ class GenericNegativeEnumConditionView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -8655,13 +8424,13 @@ class GenericNegativeEnumConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -8679,9 +8448,9 @@ class GenericNegativeEnumConditionView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -8690,13 +8459,13 @@ class GenericNegativeEnumConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -8727,7 +8496,7 @@ struct EmbossReservedInternalIsGenericNegativeEnumConditionView< }; template -inline GenericNegativeEnumConditionView< +[[nodiscard]] inline GenericNegativeEnumConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -8742,7 +8511,7 @@ MakeNegativeEnumConditionView( T &&emboss_reserved_local_arg) { } template -inline GenericNegativeEnumConditionView> +[[nodiscard]] inline GenericNegativeEnumConditionView> MakeNegativeEnumConditionView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericNegativeEnumConditionView>( @@ -8751,7 +8520,7 @@ MakeNegativeEnumConditionView( T *emboss_reserved_local_data, } template -inline GenericNegativeEnumConditionView< +[[nodiscard]] inline GenericNegativeEnumConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedNegativeEnumConditionView( T *emboss_reserved_local_data, @@ -8817,64 +8586,49 @@ class GenericLessThanConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::LessThan(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(5LL))); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::LessThan((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(5LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_3; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!xc().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericLessThanConditionView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -8912,7 +8666,7 @@ class GenericLessThanConditionView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericLessThanConditionView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -8959,7 +8713,7 @@ class GenericLessThanConditionView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericLessThanConditionView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -9092,23 +8846,23 @@ class GenericLessThanConditionView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -9127,17 +8881,17 @@ class GenericLessThanConditionView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -9150,12 +8904,12 @@ class GenericLessThanConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::LessThan(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(5LL))); @@ -9165,7 +8919,7 @@ class GenericLessThanConditionView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -9173,8 +8927,8 @@ class GenericLessThanConditionView final { const GenericLessThanConditionView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -9190,9 +8944,9 @@ class GenericLessThanConditionView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -9201,13 +8955,13 @@ class GenericLessThanConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -9225,9 +8979,9 @@ class GenericLessThanConditionView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -9236,13 +8990,13 @@ class GenericLessThanConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -9273,7 +9027,7 @@ struct EmbossReservedInternalIsGenericLessThanConditionView< }; template -inline GenericLessThanConditionView< +[[nodiscard]] inline GenericLessThanConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -9288,7 +9042,7 @@ MakeLessThanConditionView( T &&emboss_reserved_local_arg) { } template -inline GenericLessThanConditionView> +[[nodiscard]] inline GenericLessThanConditionView> MakeLessThanConditionView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericLessThanConditionView>( @@ -9297,7 +9051,7 @@ MakeLessThanConditionView( T *emboss_reserved_local_data, } template -inline GenericLessThanConditionView< +[[nodiscard]] inline GenericLessThanConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedLessThanConditionView( T *emboss_reserved_local_data, @@ -9363,64 +9117,49 @@ class GenericLessThanOrEqualConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::LessThanOrEqual(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(5LL))); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::LessThanOrEqual((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(5LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_3; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!xc().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericLessThanOrEqualConditionView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -9458,7 +9197,7 @@ class GenericLessThanOrEqualConditionView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericLessThanOrEqualConditionView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -9505,7 +9244,7 @@ class GenericLessThanOrEqualConditionView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericLessThanOrEqualConditionView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -9638,23 +9377,23 @@ class GenericLessThanOrEqualConditionView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -9673,17 +9412,17 @@ class GenericLessThanOrEqualConditionView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -9696,12 +9435,12 @@ class GenericLessThanOrEqualConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::LessThanOrEqual(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(5LL))); @@ -9711,7 +9450,7 @@ class GenericLessThanOrEqualConditionView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -9719,8 +9458,8 @@ class GenericLessThanOrEqualConditionView final { const GenericLessThanOrEqualConditionView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -9736,9 +9475,9 @@ class GenericLessThanOrEqualConditionView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -9747,13 +9486,13 @@ class GenericLessThanOrEqualConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -9771,9 +9510,9 @@ class GenericLessThanOrEqualConditionView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -9782,13 +9521,13 @@ class GenericLessThanOrEqualConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -9819,7 +9558,7 @@ struct EmbossReservedInternalIsGenericLessThanOrEqualConditionView< }; template -inline GenericLessThanOrEqualConditionView< +[[nodiscard]] inline GenericLessThanOrEqualConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -9834,7 +9573,7 @@ MakeLessThanOrEqualConditionView( T &&emboss_reserved_local_arg) { } template -inline GenericLessThanOrEqualConditionView> +[[nodiscard]] inline GenericLessThanOrEqualConditionView> MakeLessThanOrEqualConditionView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericLessThanOrEqualConditionView>( @@ -9843,7 +9582,7 @@ MakeLessThanOrEqualConditionView( T *emboss_reserved_local_data, } template -inline GenericLessThanOrEqualConditionView< +[[nodiscard]] inline GenericLessThanOrEqualConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedLessThanOrEqualConditionView( T *emboss_reserved_local_data, @@ -9909,64 +9648,49 @@ class GenericGreaterThanOrEqualConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::GreaterThanOrEqual(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(5LL))); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThanOrEqual((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(5LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_3; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!xc().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericGreaterThanOrEqualConditionView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -10004,7 +9728,7 @@ class GenericGreaterThanOrEqualConditionView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericGreaterThanOrEqualConditionView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -10051,7 +9775,7 @@ class GenericGreaterThanOrEqualConditionView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericGreaterThanOrEqualConditionView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -10184,23 +9908,23 @@ class GenericGreaterThanOrEqualConditionView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -10219,17 +9943,17 @@ class GenericGreaterThanOrEqualConditionView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -10242,12 +9966,12 @@ class GenericGreaterThanOrEqualConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::GreaterThanOrEqual(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(5LL))); @@ -10257,7 +9981,7 @@ class GenericGreaterThanOrEqualConditionView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -10265,8 +9989,8 @@ class GenericGreaterThanOrEqualConditionView final { const GenericGreaterThanOrEqualConditionView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -10282,9 +10006,9 @@ class GenericGreaterThanOrEqualConditionView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -10293,13 +10017,13 @@ class GenericGreaterThanOrEqualConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -10317,9 +10041,9 @@ class GenericGreaterThanOrEqualConditionView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -10328,13 +10052,13 @@ class GenericGreaterThanOrEqualConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -10365,7 +10089,7 @@ struct EmbossReservedInternalIsGenericGreaterThanOrEqualConditionView< }; template -inline GenericGreaterThanOrEqualConditionView< +[[nodiscard]] inline GenericGreaterThanOrEqualConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -10380,7 +10104,7 @@ MakeGreaterThanOrEqualConditionView( T &&emboss_reserved_local_arg) { } template -inline GenericGreaterThanOrEqualConditionView> +[[nodiscard]] inline GenericGreaterThanOrEqualConditionView> MakeGreaterThanOrEqualConditionView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericGreaterThanOrEqualConditionView>( @@ -10389,7 +10113,7 @@ MakeGreaterThanOrEqualConditionView( T *emboss_reserved_local_data, } template -inline GenericGreaterThanOrEqualConditionView< +[[nodiscard]] inline GenericGreaterThanOrEqualConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedGreaterThanOrEqualConditionView( T *emboss_reserved_local_data, @@ -10455,64 +10179,49 @@ class GenericGreaterThanConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::GreaterThan(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(5LL))); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThan((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(5LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_3; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!xc().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericGreaterThanConditionView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -10550,7 +10259,7 @@ class GenericGreaterThanConditionView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericGreaterThanConditionView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -10597,7 +10306,7 @@ class GenericGreaterThanConditionView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericGreaterThanConditionView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -10730,23 +10439,23 @@ class GenericGreaterThanConditionView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -10765,17 +10474,17 @@ class GenericGreaterThanConditionView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -10788,12 +10497,12 @@ class GenericGreaterThanConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::GreaterThan(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(5LL))); @@ -10803,7 +10512,7 @@ class GenericGreaterThanConditionView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -10811,8 +10520,8 @@ class GenericGreaterThanConditionView final { const GenericGreaterThanConditionView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -10828,9 +10537,9 @@ class GenericGreaterThanConditionView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -10839,13 +10548,13 @@ class GenericGreaterThanConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -10863,9 +10572,9 @@ class GenericGreaterThanConditionView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -10874,13 +10583,13 @@ class GenericGreaterThanConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -10911,7 +10620,7 @@ struct EmbossReservedInternalIsGenericGreaterThanConditionView< }; template -inline GenericGreaterThanConditionView< +[[nodiscard]] inline GenericGreaterThanConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -10926,7 +10635,7 @@ MakeGreaterThanConditionView( T &&emboss_reserved_local_arg) { } template -inline GenericGreaterThanConditionView> +[[nodiscard]] inline GenericGreaterThanConditionView> MakeGreaterThanConditionView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericGreaterThanConditionView>( @@ -10935,7 +10644,7 @@ MakeGreaterThanConditionView( T *emboss_reserved_local_data, } template -inline GenericGreaterThanConditionView< +[[nodiscard]] inline GenericGreaterThanConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedGreaterThanConditionView( T *emboss_reserved_local_data, @@ -11002,73 +10711,56 @@ class GenericRangeConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - const auto emboss_reserved_local_ok_subexpr_1 = x(); - const auto emboss_reserved_local_ok_subexpr_2 = y(); - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::And(::emboss::support::LessThan(::emboss::support::Maybe(static_cast(5LL)), (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe())), ::emboss::support::LessThanOrEqual((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), (emboss_reserved_local_ok_subexpr_2.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_2.UncheckedRead())) : ::emboss::support::Maybe()))), ::emboss::support::LessThan((emboss_reserved_local_ok_subexpr_2.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_2.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(10LL)))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::LessThan(::emboss::support::Maybe(static_cast(5LL)), emboss_reserved_local_ok_subexpr_2); + const auto emboss_reserved_local_ok_subexpr_4 = y(); + const auto emboss_reserved_local_ok_subexpr_5 = (emboss_reserved_local_ok_subexpr_4.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_4.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_6 = ::emboss::support::LessThanOrEqual(emboss_reserved_local_ok_subexpr_2, emboss_reserved_local_ok_subexpr_5); + const auto emboss_reserved_local_ok_subexpr_7 = ::emboss::support::And(emboss_reserved_local_ok_subexpr_3, emboss_reserved_local_ok_subexpr_6); + const auto emboss_reserved_local_ok_subexpr_8 = ::emboss::support::LessThan(emboss_reserved_local_ok_subexpr_5, ::emboss::support::Maybe(static_cast(10LL))); + const auto emboss_reserved_local_ok_subexpr_9 = ::emboss::support::And(emboss_reserved_local_ok_subexpr_7, emboss_reserved_local_ok_subexpr_8); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!y().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_9; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!xc().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericRangeConditionView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -11123,7 +10815,7 @@ class GenericRangeConditionView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericRangeConditionView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -11184,7 +10876,7 @@ class GenericRangeConditionView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericRangeConditionView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -11355,31 +11047,31 @@ class GenericRangeConditionView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> y() const; - ::emboss::support::Maybe has_y() const; + [[nodiscard]] ::emboss::support::Maybe has_y() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -11398,17 +11090,17 @@ class GenericRangeConditionView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -11421,12 +11113,12 @@ class GenericRangeConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::LessThan(::emboss::support::Maybe(static_cast(5LL)), emboss_reserved_local_subexpr_2); @@ -11442,7 +11134,7 @@ class GenericRangeConditionView final { return emboss_reserved_local_subexpr_11; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -11450,8 +11142,8 @@ class GenericRangeConditionView final { const GenericRangeConditionView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -11467,9 +11159,9 @@ class GenericRangeConditionView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -11478,13 +11170,13 @@ class GenericRangeConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -11502,9 +11194,9 @@ class GenericRangeConditionView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -11513,13 +11205,13 @@ class GenericRangeConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -11550,7 +11242,7 @@ struct EmbossReservedInternalIsGenericRangeConditionView< }; template -inline GenericRangeConditionView< +[[nodiscard]] inline GenericRangeConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -11565,7 +11257,7 @@ MakeRangeConditionView( T &&emboss_reserved_local_arg) { } template -inline GenericRangeConditionView> +[[nodiscard]] inline GenericRangeConditionView> MakeRangeConditionView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericRangeConditionView>( @@ -11574,7 +11266,7 @@ MakeRangeConditionView( T *emboss_reserved_local_data, } template -inline GenericRangeConditionView< +[[nodiscard]] inline GenericRangeConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedRangeConditionView( T *emboss_reserved_local_data, @@ -11641,73 +11333,56 @@ class GenericReverseRangeConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - const auto emboss_reserved_local_ok_subexpr_1 = y(); - const auto emboss_reserved_local_ok_subexpr_2 = x(); - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::And(::emboss::support::GreaterThan(::emboss::support::Maybe(static_cast(10LL)), (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe())), ::emboss::support::GreaterThanOrEqual((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), (emboss_reserved_local_ok_subexpr_2.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_2.UncheckedRead())) : ::emboss::support::Maybe()))), ::emboss::support::GreaterThan((emboss_reserved_local_ok_subexpr_2.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_2.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(5LL)))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - + const auto emboss_reserved_local_ok_subexpr_1 = y(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::GreaterThan(::emboss::support::Maybe(static_cast(10LL)), emboss_reserved_local_ok_subexpr_2); + const auto emboss_reserved_local_ok_subexpr_4 = x(); + const auto emboss_reserved_local_ok_subexpr_5 = (emboss_reserved_local_ok_subexpr_4.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_4.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_6 = ::emboss::support::GreaterThanOrEqual(emboss_reserved_local_ok_subexpr_2, emboss_reserved_local_ok_subexpr_5); + const auto emboss_reserved_local_ok_subexpr_7 = ::emboss::support::And(emboss_reserved_local_ok_subexpr_3, emboss_reserved_local_ok_subexpr_6); + const auto emboss_reserved_local_ok_subexpr_8 = ::emboss::support::GreaterThan(emboss_reserved_local_ok_subexpr_5, ::emboss::support::Maybe(static_cast(5LL))); + const auto emboss_reserved_local_ok_subexpr_9 = ::emboss::support::And(emboss_reserved_local_ok_subexpr_7, emboss_reserved_local_ok_subexpr_8); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!y().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_9; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!xc().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericReverseRangeConditionView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -11762,7 +11437,7 @@ class GenericReverseRangeConditionView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericReverseRangeConditionView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -11823,7 +11498,7 @@ class GenericReverseRangeConditionView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericReverseRangeConditionView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -11994,31 +11669,31 @@ class GenericReverseRangeConditionView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> y() const; - ::emboss::support::Maybe has_y() const; + [[nodiscard]] ::emboss::support::Maybe has_y() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -12037,17 +11712,17 @@ class GenericReverseRangeConditionView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -12060,12 +11735,12 @@ class GenericReverseRangeConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.y(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::GreaterThan(::emboss::support::Maybe(static_cast(10LL)), emboss_reserved_local_subexpr_2); @@ -12081,7 +11756,7 @@ class GenericReverseRangeConditionView final { return emboss_reserved_local_subexpr_11; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -12089,8 +11764,8 @@ class GenericReverseRangeConditionView final { const GenericReverseRangeConditionView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -12106,9 +11781,9 @@ class GenericReverseRangeConditionView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -12117,13 +11792,13 @@ class GenericReverseRangeConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -12141,9 +11816,9 @@ class GenericReverseRangeConditionView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -12152,13 +11827,13 @@ class GenericReverseRangeConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -12189,7 +11864,7 @@ struct EmbossReservedInternalIsGenericReverseRangeConditionView< }; template -inline GenericReverseRangeConditionView< +[[nodiscard]] inline GenericReverseRangeConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -12204,7 +11879,7 @@ MakeReverseRangeConditionView( T &&emboss_reserved_local_arg) { } template -inline GenericReverseRangeConditionView> +[[nodiscard]] inline GenericReverseRangeConditionView> MakeReverseRangeConditionView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericReverseRangeConditionView>( @@ -12213,7 +11888,7 @@ MakeReverseRangeConditionView( T *emboss_reserved_local_data, } template -inline GenericReverseRangeConditionView< +[[nodiscard]] inline GenericReverseRangeConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedReverseRangeConditionView( T *emboss_reserved_local_data, @@ -12280,71 +11955,54 @@ class GenericAndConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(5LL))); + const auto emboss_reserved_local_ok_subexpr_4 = y(); + const auto emboss_reserved_local_ok_subexpr_5 = (emboss_reserved_local_ok_subexpr_4.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_4.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_6 = ::emboss::support::Equal(emboss_reserved_local_ok_subexpr_5, ::emboss::support::Maybe(static_cast(5LL))); + const auto emboss_reserved_local_ok_subexpr_7 = ::emboss::support::And(emboss_reserved_local_ok_subexpr_3, emboss_reserved_local_ok_subexpr_6); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::Equal((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(5LL))), ::emboss::support::Equal((y().Ok() ? ::emboss::support::Maybe(static_cast(y().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(5LL)))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!y().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_7; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!xc().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericAndConditionView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -12399,7 +12057,7 @@ class GenericAndConditionView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericAndConditionView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -12460,7 +12118,7 @@ class GenericAndConditionView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericAndConditionView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -12631,31 +12289,31 @@ class GenericAndConditionView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> y() const; - ::emboss::support::Maybe has_y() const; + [[nodiscard]] ::emboss::support::Maybe has_y() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -12674,17 +12332,17 @@ class GenericAndConditionView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -12697,12 +12355,12 @@ class GenericAndConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(5LL))); @@ -12716,7 +12374,7 @@ class GenericAndConditionView final { return emboss_reserved_local_subexpr_9; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -12724,8 +12382,8 @@ class GenericAndConditionView final { const GenericAndConditionView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -12741,9 +12399,9 @@ class GenericAndConditionView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -12752,13 +12410,13 @@ class GenericAndConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -12776,9 +12434,9 @@ class GenericAndConditionView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -12787,13 +12445,13 @@ class GenericAndConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -12824,7 +12482,7 @@ struct EmbossReservedInternalIsGenericAndConditionView< }; template -inline GenericAndConditionView< +[[nodiscard]] inline GenericAndConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -12839,7 +12497,7 @@ MakeAndConditionView( T &&emboss_reserved_local_arg) { } template -inline GenericAndConditionView> +[[nodiscard]] inline GenericAndConditionView> MakeAndConditionView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericAndConditionView>( @@ -12848,7 +12506,7 @@ MakeAndConditionView( T *emboss_reserved_local_data, } template -inline GenericAndConditionView< +[[nodiscard]] inline GenericAndConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedAndConditionView( T *emboss_reserved_local_data, @@ -12915,71 +12573,54 @@ class GenericOrConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(5LL))); + const auto emboss_reserved_local_ok_subexpr_4 = y(); + const auto emboss_reserved_local_ok_subexpr_5 = (emboss_reserved_local_ok_subexpr_4.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_4.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_6 = ::emboss::support::Equal(emboss_reserved_local_ok_subexpr_5, ::emboss::support::Maybe(static_cast(5LL))); + const auto emboss_reserved_local_ok_subexpr_7 = ::emboss::support::Or(emboss_reserved_local_ok_subexpr_3, emboss_reserved_local_ok_subexpr_6); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Or(::emboss::support::Equal((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(5LL))), ::emboss::support::Equal((y().Ok() ? ::emboss::support::Maybe(static_cast(y().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(5LL)))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!y().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_7; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!xc().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericOrConditionView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -13034,7 +12675,7 @@ class GenericOrConditionView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericOrConditionView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -13095,7 +12736,7 @@ class GenericOrConditionView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericOrConditionView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -13266,31 +12907,31 @@ class GenericOrConditionView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> y() const; - ::emboss::support::Maybe has_y() const; + [[nodiscard]] ::emboss::support::Maybe has_y() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -13309,17 +12950,17 @@ class GenericOrConditionView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -13332,12 +12973,12 @@ class GenericOrConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(5LL))); @@ -13351,7 +12992,7 @@ class GenericOrConditionView final { return emboss_reserved_local_subexpr_9; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -13359,8 +13000,8 @@ class GenericOrConditionView final { const GenericOrConditionView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -13376,9 +13017,9 @@ class GenericOrConditionView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -13387,13 +13028,13 @@ class GenericOrConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -13411,9 +13052,9 @@ class GenericOrConditionView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -13422,13 +13063,13 @@ class GenericOrConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -13459,7 +13100,7 @@ struct EmbossReservedInternalIsGenericOrConditionView< }; template -inline GenericOrConditionView< +[[nodiscard]] inline GenericOrConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -13474,7 +13115,7 @@ MakeOrConditionView( T &&emboss_reserved_local_arg) { } template -inline GenericOrConditionView> +[[nodiscard]] inline GenericOrConditionView> MakeOrConditionView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericOrConditionView>( @@ -13483,7 +13124,7 @@ MakeOrConditionView( T *emboss_reserved_local_data, } template -inline GenericOrConditionView< +[[nodiscard]] inline GenericOrConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedOrConditionView( T *emboss_reserved_local_data, @@ -13638,78 +13279,58 @@ class GenericChoiceConditionView final { using Field = ::emboss::test::ChoiceCondition::Field; - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = field(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(1))); + const auto emboss_reserved_local_ok_subexpr_4 = x(); + const auto emboss_reserved_local_ok_subexpr_5 = (emboss_reserved_local_ok_subexpr_4.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_4.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_6 = y(); + const auto emboss_reserved_local_ok_subexpr_7 = (emboss_reserved_local_ok_subexpr_6.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_6.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_8 = ::emboss::support::Choice(emboss_reserved_local_ok_subexpr_3, emboss_reserved_local_ok_subexpr_5, emboss_reserved_local_ok_subexpr_7); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !field().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal(::emboss::support::Choice(::emboss::support::Equal((field().Ok() ? ::emboss::support::Maybe(static_cast(field().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(1))), (x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), (y().Ok() ? ::emboss::support::Maybe(static_cast(y().UncheckedRead())) : ::emboss::support::Maybe())), ::emboss::support::Maybe(static_cast(5LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xyc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!field().Ok()) return false; + if (!x().Ok()) return false; + if (!y().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_switch_discrim = emboss_reserved_local_ok_subexpr_8; + if (!emboss_reserved_switch_discrim.Known()) return false; + switch (emboss_reserved_switch_discrim.ValueOrDefault()) { + case static_cast(5LL): + if (!xyc().Ok()) return false; + break; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericChoiceConditionView emboss_reserved_local_other) const { if (!has_field().Known()) return false; @@ -13781,7 +13402,7 @@ class GenericChoiceConditionView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericChoiceConditionView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_field().ValueOr(false) && @@ -13856,7 +13477,7 @@ class GenericChoiceConditionView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericChoiceConditionView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -14065,40 +13686,40 @@ class GenericChoiceConditionView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::ChoiceCondition::Field, ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> field() const; - ::emboss::support::Maybe has_field() const; + [[nodiscard]] ::emboss::support::Maybe has_field() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> y() const; - ::emboss::support::Maybe has_y() const; + [[nodiscard]] ::emboss::support::Maybe has_y() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xyc() const; - ::emboss::support::Maybe has_xyc() const; + [[nodiscard]] ::emboss::support::Maybe has_xyc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -14117,17 +13738,17 @@ class GenericChoiceConditionView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -14140,12 +13761,12 @@ class GenericChoiceConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.field(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(1))); @@ -14161,7 +13782,7 @@ class GenericChoiceConditionView final { return emboss_reserved_local_subexpr_11; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -14169,8 +13790,8 @@ class GenericChoiceConditionView final { const GenericChoiceConditionView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -14186,9 +13807,9 @@ class GenericChoiceConditionView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -14197,13 +13818,13 @@ class GenericChoiceConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -14221,9 +13842,9 @@ class GenericChoiceConditionView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -14232,13 +13853,13 @@ class GenericChoiceConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -14269,7 +13890,7 @@ struct EmbossReservedInternalIsGenericChoiceConditionView< }; template -inline GenericChoiceConditionView< +[[nodiscard]] inline GenericChoiceConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -14284,7 +13905,7 @@ MakeChoiceConditionView( T &&emboss_reserved_local_arg) { } template -inline GenericChoiceConditionView> +[[nodiscard]] inline GenericChoiceConditionView> MakeChoiceConditionView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericChoiceConditionView>( @@ -14293,7 +13914,7 @@ MakeChoiceConditionView( T *emboss_reserved_local_data, } template -inline GenericChoiceConditionView< +[[nodiscard]] inline GenericChoiceConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedChoiceConditionView( T *emboss_reserved_local_data, @@ -14365,65 +13986,41 @@ class GenericEmbossReservedAnonymousField3View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !has_top().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !has_bottom().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!has_top().Ok()) return false; + if (!has_bottom().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericEmbossReservedAnonymousField3View emboss_reserved_local_other) const { if (!has_has_top().Known()) return false; @@ -14461,7 +14058,7 @@ class GenericEmbossReservedAnonymousField3View final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericEmbossReservedAnonymousField3View emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_has_top().ValueOr(false) && @@ -14508,7 +14105,7 @@ class GenericEmbossReservedAnonymousField3View final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericEmbossReservedAnonymousField3View emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -14641,23 +14238,23 @@ class GenericEmbossReservedAnonymousField3View final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> has_top() const; - ::emboss::support::Maybe has_has_top() const; + [[nodiscard]] ::emboss::support::Maybe has_has_top() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> has_bottom() const; - ::emboss::support::Maybe has_has_bottom() const; + [[nodiscard]] ::emboss::support::Maybe has_has_bottom() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -14673,9 +14270,9 @@ class GenericEmbossReservedAnonymousField3View final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -14684,13 +14281,13 @@ class GenericEmbossReservedAnonymousField3View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -14708,9 +14305,9 @@ class GenericEmbossReservedAnonymousField3View final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -14719,13 +14316,13 @@ class GenericEmbossReservedAnonymousField3View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -14743,9 +14340,9 @@ class GenericEmbossReservedAnonymousField3View final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -14754,13 +14351,13 @@ class GenericEmbossReservedAnonymousField3View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -14791,7 +14388,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField3View< }; template -inline GenericEmbossReservedAnonymousField3View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField3View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -14806,7 +14403,7 @@ MakeEmbossReservedAnonymousField3View( T &&emboss_reserved_local_arg) { } template -inline GenericEmbossReservedAnonymousField3View> +[[nodiscard]] inline GenericEmbossReservedAnonymousField3View> MakeEmbossReservedAnonymousField3View( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericEmbossReservedAnonymousField3View>( @@ -14815,7 +14412,7 @@ MakeEmbossReservedAnonymousField3View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField3View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField3View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField3View( T *emboss_reserved_local_data, @@ -14876,73 +14473,49 @@ class GenericContainsBitsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_3().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !has_top().Ok()) return false; - } - + const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !has_bottom().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!emboss_reserved_anonymous_field_3().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!has_top().Ok()) return false; + if (!has_bottom().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericContainsBitsView emboss_reserved_local_other) const { if (!has_emboss_reserved_anonymous_field_3().Known()) return false; @@ -14963,7 +14536,7 @@ class GenericContainsBitsView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericContainsBitsView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_emboss_reserved_anonymous_field_3().ValueOr(false) && @@ -14996,7 +14569,7 @@ class GenericContainsBitsView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericContainsBitsView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -15129,27 +14702,27 @@ class GenericContainsBitsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } private: - typename ::emboss::test::ContainsBits::GenericEmbossReservedAnonymousField3View>, 8>> + [[nodiscard]] typename ::emboss::test::ContainsBits::GenericEmbossReservedAnonymousField3View>, 8>> emboss_reserved_anonymous_field_3() const; - ::emboss::support::Maybe has_emboss_reserved_anonymous_field_3() const; + [[nodiscard]] ::emboss::support::Maybe has_emboss_reserved_anonymous_field_3() const; public: - auto has_top() const -> decltype(this->emboss_reserved_anonymous_field_3().has_top()) { + [[nodiscard]] auto has_top() const -> decltype(this->emboss_reserved_anonymous_field_3().has_top()) { return has_has_top().ValueOrDefault() ? emboss_reserved_anonymous_field_3().has_top() : decltype(this->emboss_reserved_anonymous_field_3().has_top())(); } - ::emboss::support::Maybe has_has_top() const; + [[nodiscard]] ::emboss::support::Maybe has_has_top() const; public: - auto has_bottom() const -> decltype(this->emboss_reserved_anonymous_field_3().has_bottom()) { + [[nodiscard]] auto has_bottom() const -> decltype(this->emboss_reserved_anonymous_field_3().has_bottom()) { return has_has_bottom().ValueOrDefault() ? emboss_reserved_anonymous_field_3().has_bottom() : decltype(this->emboss_reserved_anonymous_field_3().has_bottom())(); } - ::emboss::support::Maybe has_has_bottom() const; + [[nodiscard]] ::emboss::support::Maybe has_has_bottom() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -15165,9 +14738,9 @@ class GenericContainsBitsView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -15176,13 +14749,13 @@ class GenericContainsBitsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -15200,9 +14773,9 @@ class GenericContainsBitsView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -15211,13 +14784,13 @@ class GenericContainsBitsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -15235,9 +14808,9 @@ class GenericContainsBitsView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -15246,13 +14819,13 @@ class GenericContainsBitsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -15283,7 +14856,7 @@ struct EmbossReservedInternalIsGenericContainsBitsView< }; template -inline GenericContainsBitsView< +[[nodiscard]] inline GenericContainsBitsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -15298,7 +14871,7 @@ MakeContainsBitsView( T &&emboss_reserved_local_arg) { } template -inline GenericContainsBitsView> +[[nodiscard]] inline GenericContainsBitsView> MakeContainsBitsView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericContainsBitsView>( @@ -15307,7 +14880,7 @@ MakeContainsBitsView( T *emboss_reserved_local_data, } template -inline GenericContainsBitsView< +[[nodiscard]] inline GenericContainsBitsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedContainsBitsView( T *emboss_reserved_local_data, @@ -15373,64 +14946,50 @@ class GenericContainsContainsBitsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = condition().has_top(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !condition().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal((condition().has_top().Ok() ? ::emboss::support::Maybe(static_cast(condition().has_top().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(1LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !top().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!condition().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_switch_discrim = emboss_reserved_local_ok_subexpr_2; + if (!emboss_reserved_switch_discrim.Known()) return false; + switch (emboss_reserved_switch_discrim.ValueOrDefault()) { + case static_cast(1LL): + if (!top().Ok()) return false; + break; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericContainsContainsBitsView emboss_reserved_local_other) const { if (!has_condition().Known()) return false; @@ -15468,7 +15027,7 @@ class GenericContainsContainsBitsView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericContainsContainsBitsView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_condition().ValueOr(false) && @@ -15515,7 +15074,7 @@ class GenericContainsContainsBitsView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericContainsContainsBitsView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -15648,21 +15207,21 @@ class GenericContainsContainsBitsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::test::GenericContainsBitsView> + [[nodiscard]] typename ::emboss::test::GenericContainsBitsView> condition() const; - ::emboss::support::Maybe has_condition() const; + [[nodiscard]] ::emboss::support::Maybe has_condition() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> top() const; - ::emboss::support::Maybe has_top() const; + [[nodiscard]] ::emboss::support::Maybe has_top() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -15681,17 +15240,17 @@ class GenericContainsContainsBitsView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -15704,12 +15263,12 @@ class GenericContainsContainsBitsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.condition().has_top(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(1LL))); @@ -15719,7 +15278,7 @@ class GenericContainsContainsBitsView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -15727,8 +15286,8 @@ class GenericContainsContainsBitsView final { const GenericContainsContainsBitsView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -15744,9 +15303,9 @@ class GenericContainsContainsBitsView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -15755,13 +15314,13 @@ class GenericContainsContainsBitsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -15779,9 +15338,9 @@ class GenericContainsContainsBitsView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -15790,13 +15349,13 @@ class GenericContainsContainsBitsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -15827,7 +15386,7 @@ struct EmbossReservedInternalIsGenericContainsContainsBitsView< }; template -inline GenericContainsContainsBitsView< +[[nodiscard]] inline GenericContainsContainsBitsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -15842,7 +15401,7 @@ MakeContainsContainsBitsView( T &&emboss_reserved_local_arg) { } template -inline GenericContainsContainsBitsView> +[[nodiscard]] inline GenericContainsContainsBitsView> MakeContainsContainsBitsView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericContainsContainsBitsView>( @@ -15851,7 +15410,7 @@ MakeContainsContainsBitsView( T *emboss_reserved_local_data, } template -inline GenericContainsContainsBitsView< +[[nodiscard]] inline GenericContainsContainsBitsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedContainsContainsBitsView( T *emboss_reserved_local_data, @@ -15924,72 +15483,42 @@ class GenericType0View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !c().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a().Ok()) return false; + if (!b().Ok()) return false; + if (!c().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericType0View emboss_reserved_local_other) const { if (!has_a().Known()) return false; @@ -16044,7 +15573,7 @@ class GenericType0View final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericType0View emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_a().ValueOr(false) && @@ -16105,7 +15634,7 @@ class GenericType0View final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericType0View emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -16276,31 +15805,31 @@ class GenericType0View final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> a() const; - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> b() const; - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> c() const; - ::emboss::support::Maybe has_c() const; + [[nodiscard]] ::emboss::support::Maybe has_c() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -16316,9 +15845,9 @@ class GenericType0View final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -16327,13 +15856,13 @@ class GenericType0View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -16351,9 +15880,9 @@ class GenericType0View final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -16362,13 +15891,13 @@ class GenericType0View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -16386,9 +15915,9 @@ class GenericType0View final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -16397,13 +15926,13 @@ class GenericType0View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -16434,7 +15963,7 @@ struct EmbossReservedInternalIsGenericType0View< }; template -inline GenericType0View< +[[nodiscard]] inline GenericType0View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -16449,7 +15978,7 @@ MakeType0View( T &&emboss_reserved_local_arg) { } template -inline GenericType0View> +[[nodiscard]] inline GenericType0View> MakeType0View( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericType0View>( @@ -16458,7 +15987,7 @@ MakeType0View( T *emboss_reserved_local_data, } template -inline GenericType0View< +[[nodiscard]] inline GenericType0View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedType0View( T *emboss_reserved_local_data, @@ -16526,72 +16055,42 @@ class GenericType1View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !c().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a().Ok()) return false; + if (!b().Ok()) return false; + if (!c().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericType1View emboss_reserved_local_other) const { if (!has_a().Known()) return false; @@ -16646,7 +16145,7 @@ class GenericType1View final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericType1View emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_a().ValueOr(false) && @@ -16707,7 +16206,7 @@ class GenericType1View final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericType1View emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -16878,31 +16377,31 @@ class GenericType1View final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> a() const; - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> b() const; - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> c() const; - ::emboss::support::Maybe has_c() const; + [[nodiscard]] ::emboss::support::Maybe has_c() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -16918,9 +16417,9 @@ class GenericType1View final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -16929,13 +16428,13 @@ class GenericType1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -16953,9 +16452,9 @@ class GenericType1View final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -16964,13 +16463,13 @@ class GenericType1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -16988,9 +16487,9 @@ class GenericType1View final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -16999,13 +16498,13 @@ class GenericType1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -17036,7 +16535,7 @@ struct EmbossReservedInternalIsGenericType1View< }; template -inline GenericType1View< +[[nodiscard]] inline GenericType1View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -17051,7 +16550,7 @@ MakeType1View( T &&emboss_reserved_local_arg) { } template -inline GenericType1View> +[[nodiscard]] inline GenericType1View> MakeType1View( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericType1View>( @@ -17060,7 +16559,7 @@ MakeType1View( T *emboss_reserved_local_data, } template -inline GenericType1View< +[[nodiscard]] inline GenericType1View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedType1View( T *emboss_reserved_local_data, @@ -17121,72 +16620,53 @@ class GenericConditionalInlineView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - const auto emboss_reserved_local_ok_subexpr_1 = payload_id(); + const auto emboss_reserved_local_ok_subexpr_1 = payload_id(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !payload_id().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !type_0().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(1LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !type_1().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!payload_id().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_switch_discrim = emboss_reserved_local_ok_subexpr_2; + if (!emboss_reserved_switch_discrim.Known()) return false; + switch (emboss_reserved_switch_discrim.ValueOrDefault()) { + case static_cast(0LL): + if (!type_0().Ok()) return false; + break; + case static_cast(1LL): + if (!type_1().Ok()) return false; + break; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericConditionalInlineView emboss_reserved_local_other) const { if (!has_payload_id().Known()) return false; @@ -17241,7 +16721,7 @@ class GenericConditionalInlineView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericConditionalInlineView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_payload_id().ValueOr(false) && @@ -17302,7 +16782,7 @@ class GenericConditionalInlineView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericConditionalInlineView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -17473,27 +16953,27 @@ class GenericConditionalInlineView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> payload_id() const; - ::emboss::support::Maybe has_payload_id() const; + [[nodiscard]] ::emboss::support::Maybe has_payload_id() const; public: - typename ::emboss::test::ConditionalInline::GenericType0View> + [[nodiscard]] typename ::emboss::test::ConditionalInline::GenericType0View> type_0() const; - ::emboss::support::Maybe has_type_0() const; + [[nodiscard]] ::emboss::support::Maybe has_type_0() const; public: - typename ::emboss::test::ConditionalInline::GenericType1View> + [[nodiscard]] typename ::emboss::test::ConditionalInline::GenericType1View> type_1() const; - ::emboss::support::Maybe has_type_1() const; + [[nodiscard]] ::emboss::support::Maybe has_type_1() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -17512,17 +16992,17 @@ class GenericConditionalInlineView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -17535,12 +17015,12 @@ class GenericConditionalInlineView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.payload_id(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(0LL))); @@ -17552,7 +17032,7 @@ class GenericConditionalInlineView final { return emboss_reserved_local_subexpr_7; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -17560,8 +17040,8 @@ class GenericConditionalInlineView final { const GenericConditionalInlineView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -17577,9 +17057,9 @@ class GenericConditionalInlineView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -17588,13 +17068,13 @@ class GenericConditionalInlineView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -17612,9 +17092,9 @@ class GenericConditionalInlineView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -17623,13 +17103,13 @@ class GenericConditionalInlineView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -17660,7 +17140,7 @@ struct EmbossReservedInternalIsGenericConditionalInlineView< }; template -inline GenericConditionalInlineView< +[[nodiscard]] inline GenericConditionalInlineView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -17675,7 +17155,7 @@ MakeConditionalInlineView( T &&emboss_reserved_local_arg) { } template -inline GenericConditionalInlineView> +[[nodiscard]] inline GenericConditionalInlineView> MakeConditionalInlineView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericConditionalInlineView>( @@ -17684,7 +17164,7 @@ MakeConditionalInlineView( T *emboss_reserved_local_data, } template -inline GenericConditionalInlineView< +[[nodiscard]] inline GenericConditionalInlineView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConditionalInlineView( T *emboss_reserved_local_data, @@ -17759,72 +17239,52 @@ class GenericEmbossReservedAnonymousField2View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = low(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !low().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal((low().Ok() ? ::emboss::support::Maybe(static_cast(low().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(1LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !mid().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !high().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!low().Ok()) return false; + if (!high().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_switch_discrim = emboss_reserved_local_ok_subexpr_2; + if (!emboss_reserved_switch_discrim.Known()) return false; + switch (emboss_reserved_switch_discrim.ValueOrDefault()) { + case static_cast(1LL): + if (!mid().Ok()) return false; + break; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericEmbossReservedAnonymousField2View emboss_reserved_local_other) const { if (!has_low().Known()) return false; @@ -17879,7 +17339,7 @@ class GenericEmbossReservedAnonymousField2View final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericEmbossReservedAnonymousField2View emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_low().ValueOr(false) && @@ -17940,7 +17400,7 @@ class GenericEmbossReservedAnonymousField2View final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericEmbossReservedAnonymousField2View emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -18111,31 +17571,31 @@ class GenericEmbossReservedAnonymousField2View final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> low() const; - ::emboss::support::Maybe has_low() const; + [[nodiscard]] ::emboss::support::Maybe has_low() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<2, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> mid() const; - ::emboss::support::Maybe has_mid() const; + [[nodiscard]] ::emboss::support::Maybe has_mid() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> high() const; - ::emboss::support::Maybe has_high() const; + [[nodiscard]] ::emboss::support::Maybe has_high() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -18151,9 +17611,9 @@ class GenericEmbossReservedAnonymousField2View final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -18162,13 +17622,13 @@ class GenericEmbossReservedAnonymousField2View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -18186,9 +17646,9 @@ class GenericEmbossReservedAnonymousField2View final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -18197,13 +17657,13 @@ class GenericEmbossReservedAnonymousField2View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -18221,9 +17681,9 @@ class GenericEmbossReservedAnonymousField2View final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -18232,13 +17692,13 @@ class GenericEmbossReservedAnonymousField2View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -18269,7 +17729,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField2View< }; template -inline GenericEmbossReservedAnonymousField2View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField2View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -18284,7 +17744,7 @@ MakeEmbossReservedAnonymousField2View( T &&emboss_reserved_local_arg) { } template -inline GenericEmbossReservedAnonymousField2View> +[[nodiscard]] inline GenericEmbossReservedAnonymousField2View> MakeEmbossReservedAnonymousField2View( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericEmbossReservedAnonymousField2View>( @@ -18293,7 +17753,7 @@ MakeEmbossReservedAnonymousField2View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField2View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField2View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField2View( T *emboss_reserved_local_data, @@ -18354,86 +17814,68 @@ class GenericConditionalAnonymousView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - const auto emboss_reserved_local_ok_subexpr_1 = has_emboss_reserved_anonymous_field_2(); - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThan((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(10LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_2().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::And(emboss_reserved_local_ok_subexpr_1, ::emboss::support::Maybe(true)); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !low().Ok()) return false; - } - + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::GreaterThan(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(10LL))); + const auto emboss_reserved_local_ok_subexpr_4 = has_emboss_reserved_anonymous_field_2(); + const auto emboss_reserved_local_ok_subexpr_5 = ::emboss::support::And(emboss_reserved_local_ok_subexpr_4, ::emboss::support::Maybe(true)); + const auto emboss_reserved_local_ok_subexpr_6 = emboss_reserved_anonymous_field_2().has_mid(); + const auto emboss_reserved_local_ok_subexpr_7 = ::emboss::support::And(emboss_reserved_local_ok_subexpr_4, emboss_reserved_local_ok_subexpr_6); { - const auto emboss_reserved_local_field_present = ::emboss::support::And(emboss_reserved_local_ok_subexpr_1, emboss_reserved_anonymous_field_2().has_mid()); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !mid().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::And(emboss_reserved_local_ok_subexpr_1, ::emboss::support::Maybe(true)); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !high().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_3; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!emboss_reserved_anonymous_field_2().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_5; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!low().Ok()) return false; + if (!high().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_7; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!mid().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericConditionalAnonymousView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -18471,7 +17913,7 @@ class GenericConditionalAnonymousView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericConditionalAnonymousView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -18518,7 +17960,7 @@ class GenericConditionalAnonymousView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericConditionalAnonymousView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -18727,42 +18169,42 @@ class GenericConditionalAnonymousView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; private: - typename ::emboss::test::ConditionalAnonymous::GenericEmbossReservedAnonymousField2View>, 8>> + [[nodiscard]] typename ::emboss::test::ConditionalAnonymous::GenericEmbossReservedAnonymousField2View>, 8>> emboss_reserved_anonymous_field_2() const; - ::emboss::support::Maybe has_emboss_reserved_anonymous_field_2() const; + [[nodiscard]] ::emboss::support::Maybe has_emboss_reserved_anonymous_field_2() const; public: - auto low() const -> decltype(this->emboss_reserved_anonymous_field_2().low()) { + [[nodiscard]] auto low() const -> decltype(this->emboss_reserved_anonymous_field_2().low()) { return has_low().ValueOrDefault() ? emboss_reserved_anonymous_field_2().low() : decltype(this->emboss_reserved_anonymous_field_2().low())(); } - ::emboss::support::Maybe has_low() const; + [[nodiscard]] ::emboss::support::Maybe has_low() const; public: - auto mid() const -> decltype(this->emboss_reserved_anonymous_field_2().mid()) { + [[nodiscard]] auto mid() const -> decltype(this->emboss_reserved_anonymous_field_2().mid()) { return has_mid().ValueOrDefault() ? emboss_reserved_anonymous_field_2().mid() : decltype(this->emboss_reserved_anonymous_field_2().mid())(); } - ::emboss::support::Maybe has_mid() const; + [[nodiscard]] ::emboss::support::Maybe has_mid() const; public: - auto high() const -> decltype(this->emboss_reserved_anonymous_field_2().high()) { + [[nodiscard]] auto high() const -> decltype(this->emboss_reserved_anonymous_field_2().high()) { return has_high().ValueOrDefault() ? emboss_reserved_anonymous_field_2().high() : decltype(this->emboss_reserved_anonymous_field_2().high())(); } - ::emboss::support::Maybe has_high() const; + [[nodiscard]] ::emboss::support::Maybe has_high() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -18781,17 +18223,17 @@ class GenericConditionalAnonymousView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -18804,12 +18246,12 @@ class GenericConditionalAnonymousView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::GreaterThan(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(10LL))); @@ -18819,7 +18261,7 @@ class GenericConditionalAnonymousView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -18827,8 +18269,8 @@ class GenericConditionalAnonymousView final { const GenericConditionalAnonymousView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -18844,9 +18286,9 @@ class GenericConditionalAnonymousView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -18855,13 +18297,13 @@ class GenericConditionalAnonymousView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -18879,9 +18321,9 @@ class GenericConditionalAnonymousView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -18890,13 +18332,13 @@ class GenericConditionalAnonymousView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -18927,7 +18369,7 @@ struct EmbossReservedInternalIsGenericConditionalAnonymousView< }; template -inline GenericConditionalAnonymousView< +[[nodiscard]] inline GenericConditionalAnonymousView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -18942,7 +18384,7 @@ MakeConditionalAnonymousView( T &&emboss_reserved_local_arg) { } template -inline GenericConditionalAnonymousView> +[[nodiscard]] inline GenericConditionalAnonymousView> MakeConditionalAnonymousView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericConditionalAnonymousView>( @@ -18951,7 +18393,7 @@ MakeConditionalAnonymousView( T *emboss_reserved_local_data, } template -inline GenericConditionalAnonymousView< +[[nodiscard]] inline GenericConditionalAnonymousView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConditionalAnonymousView( T *emboss_reserved_local_data, @@ -19022,58 +18464,40 @@ class GenericEmbossReservedAnonymousField1View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !enabled().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!enabled().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { if (!has_enabled().Known()) return false; @@ -19094,7 +18518,7 @@ class GenericEmbossReservedAnonymousField1View final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_enabled().ValueOr(false) && @@ -19127,7 +18551,7 @@ class GenericEmbossReservedAnonymousField1View final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -19222,15 +18646,15 @@ class GenericEmbossReservedAnonymousField1View final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> enabled() const; - ::emboss::support::Maybe has_enabled() const; + [[nodiscard]] ::emboss::support::Maybe has_enabled() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -19246,9 +18670,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -19257,13 +18681,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -19281,9 +18705,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -19292,13 +18716,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -19316,9 +18740,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -19327,13 +18751,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -19364,7 +18788,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField1View< }; template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -19379,7 +18803,7 @@ MakeEmbossReservedAnonymousField1View( T &&emboss_reserved_local_arg) { } template -inline GenericEmbossReservedAnonymousField1View> +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View> MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericEmbossReservedAnonymousField1View>( @@ -19388,7 +18812,7 @@ MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, @@ -19449,71 +18873,56 @@ class GenericConditionalOnFlagView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); + const auto emboss_reserved_local_ok_subexpr_2 = enabled(); + const auto emboss_reserved_local_ok_subexpr_3 = (emboss_reserved_local_ok_subexpr_2.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_2.UncheckedRead())) : ::emboss::support::Maybe()); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !enabled().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = (enabled().Ok() ? ::emboss::support::Maybe(static_cast(enabled().UncheckedRead())) : ::emboss::support::Maybe()); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !value().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!emboss_reserved_anonymous_field_1().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!enabled().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_3; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!value().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericConditionalOnFlagView emboss_reserved_local_other) const { if (!has_emboss_reserved_anonymous_field_1().Known()) return false; @@ -19551,7 +18960,7 @@ class GenericConditionalOnFlagView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericConditionalOnFlagView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_emboss_reserved_anonymous_field_1().ValueOr(false) && @@ -19598,7 +19007,7 @@ class GenericConditionalOnFlagView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericConditionalOnFlagView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -19731,28 +19140,28 @@ class GenericConditionalOnFlagView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } private: - typename ::emboss::test::ConditionalOnFlag::GenericEmbossReservedAnonymousField1View>, 8>> + [[nodiscard]] typename ::emboss::test::ConditionalOnFlag::GenericEmbossReservedAnonymousField1View>, 8>> emboss_reserved_anonymous_field_1() const; - ::emboss::support::Maybe has_emboss_reserved_anonymous_field_1() const; + [[nodiscard]] ::emboss::support::Maybe has_emboss_reserved_anonymous_field_1() const; public: - auto enabled() const -> decltype(this->emboss_reserved_anonymous_field_1().enabled()) { + [[nodiscard]] auto enabled() const -> decltype(this->emboss_reserved_anonymous_field_1().enabled()) { return has_enabled().ValueOrDefault() ? emboss_reserved_anonymous_field_1().enabled() : decltype(this->emboss_reserved_anonymous_field_1().enabled())(); } - ::emboss::support::Maybe has_enabled() const; + [[nodiscard]] ::emboss::support::Maybe has_enabled() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> value() const; - ::emboss::support::Maybe has_value() const; + [[nodiscard]] ::emboss::support::Maybe has_value() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -19771,17 +19180,17 @@ class GenericConditionalOnFlagView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -19794,12 +19203,12 @@ class GenericConditionalOnFlagView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.enabled(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Choice(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(2LL)), ::emboss::support::Maybe(static_cast(0LL))); @@ -19808,7 +19217,7 @@ class GenericConditionalOnFlagView final { return emboss_reserved_local_subexpr_4; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -19816,8 +19225,8 @@ class GenericConditionalOnFlagView final { const GenericConditionalOnFlagView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -19833,9 +19242,9 @@ class GenericConditionalOnFlagView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -19844,13 +19253,13 @@ class GenericConditionalOnFlagView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -19868,9 +19277,9 @@ class GenericConditionalOnFlagView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -19879,13 +19288,13 @@ class GenericConditionalOnFlagView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -19916,7 +19325,7 @@ struct EmbossReservedInternalIsGenericConditionalOnFlagView< }; template -inline GenericConditionalOnFlagView< +[[nodiscard]] inline GenericConditionalOnFlagView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -19931,7 +19340,7 @@ MakeConditionalOnFlagView( T &&emboss_reserved_local_arg) { } template -inline GenericConditionalOnFlagView> +[[nodiscard]] inline GenericConditionalOnFlagView> MakeConditionalOnFlagView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericConditionalOnFlagView>( @@ -19940,7 +19349,7 @@ MakeConditionalOnFlagView( T *emboss_reserved_local_data, } template -inline GenericConditionalOnFlagView< +[[nodiscard]] inline GenericConditionalOnFlagView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConditionalOnFlagView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/dynamic_size.emb.h b/testdata/golden_cpp/dynamic_size.emb.h index cfbe3b7..41ce2ea 100644 --- a/testdata/golden_cpp/dynamic_size.emb.h +++ b/testdata/golden_cpp/dynamic_size.emb.h @@ -171,85 +171,43 @@ class GenericMessageView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !header_length().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !message_length().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !padding().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !message().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !crc32().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!header_length().Ok()) return false; + if (!message_length().Ok()) return false; + if (!padding().Ok()) return false; + if (!message().Ok()) return false; + if (!crc32().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericMessageView emboss_reserved_local_other) const { if (!has_header_length().Known()) return false; @@ -338,7 +296,7 @@ class GenericMessageView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericMessageView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_header_length().ValueOr(false) && @@ -427,7 +385,7 @@ class GenericMessageView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericMessageView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -674,26 +632,26 @@ class GenericMessageView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> header_length() const; - ::emboss::support::Maybe has_header_length() const; + [[nodiscard]] ::emboss::support::Maybe has_header_length() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> message_length() const; - ::emboss::support::Maybe has_message_length() const; + [[nodiscard]] ::emboss::support::Maybe has_message_length() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 8>> @@ -702,10 +660,10 @@ class GenericMessageView final { 8 > padding() const; - ::emboss::support::Maybe has_padding() const; + [[nodiscard]] ::emboss::support::Maybe has_padding() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 8>> @@ -714,15 +672,15 @@ class GenericMessageView final { 8 > message() const; - ::emboss::support::Maybe has_message() const; + [[nodiscard]] ::emboss::support::Maybe has_message() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> crc32() const; - ::emboss::support::Maybe has_crc32() const; + [[nodiscard]] ::emboss::support::Maybe has_crc32() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -741,17 +699,17 @@ class GenericMessageView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -764,12 +722,12 @@ class GenericMessageView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.header_length(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Difference(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(2LL))); @@ -786,7 +744,7 @@ class GenericMessageView final { return emboss_reserved_local_subexpr_12; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -794,8 +752,8 @@ class GenericMessageView final { const GenericMessageView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -811,9 +769,9 @@ class GenericMessageView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -822,13 +780,13 @@ class GenericMessageView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -846,9 +804,9 @@ class GenericMessageView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -857,13 +815,13 @@ class GenericMessageView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -894,7 +852,7 @@ struct EmbossReservedInternalIsGenericMessageView< }; template -inline GenericMessageView< +[[nodiscard]] inline GenericMessageView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -909,7 +867,7 @@ MakeMessageView( T &&emboss_reserved_local_arg) { } template -inline GenericMessageView> +[[nodiscard]] inline GenericMessageView> MakeMessageView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericMessageView>( @@ -918,7 +876,7 @@ MakeMessageView( T *emboss_reserved_local_data, } template -inline GenericMessageView< +[[nodiscard]] inline GenericMessageView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedMessageView( T *emboss_reserved_local_data, @@ -984,64 +942,40 @@ class GenericImageView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !size().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !pixels().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!size().Ok()) return false; + if (!pixels().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericImageView emboss_reserved_local_other) const { if (!has_size().Known()) return false; @@ -1079,7 +1013,7 @@ class GenericImageView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericImageView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_size().ValueOr(false) && @@ -1126,7 +1060,7 @@ class GenericImageView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericImageView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1259,18 +1193,18 @@ class GenericImageView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> size() const; - ::emboss::support::Maybe has_size() const; + [[nodiscard]] ::emboss::support::Maybe has_size() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::support::GenericArrayView< typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< @@ -1287,7 +1221,7 @@ class GenericImageView final { 8 > pixels() const; - ::emboss::support::Maybe has_pixels() const; + [[nodiscard]] ::emboss::support::Maybe has_pixels() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -1306,17 +1240,17 @@ class GenericImageView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -1329,12 +1263,12 @@ class GenericImageView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.size(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Product(::emboss::support::Maybe(static_cast(15LL)), emboss_reserved_local_subexpr_2); @@ -1345,7 +1279,7 @@ class GenericImageView final { return emboss_reserved_local_subexpr_6; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -1353,8 +1287,8 @@ class GenericImageView final { const GenericImageView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -1370,9 +1304,9 @@ class GenericImageView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1381,13 +1315,13 @@ class GenericImageView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1405,9 +1339,9 @@ class GenericImageView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1416,13 +1350,13 @@ class GenericImageView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1453,7 +1387,7 @@ struct EmbossReservedInternalIsGenericImageView< }; template -inline GenericImageView< +[[nodiscard]] inline GenericImageView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1468,7 +1402,7 @@ MakeImageView( T &&emboss_reserved_local_arg) { } template -inline GenericImageView> +[[nodiscard]] inline GenericImageView> MakeImageView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericImageView>( @@ -1477,7 +1411,7 @@ MakeImageView( T *emboss_reserved_local_data, } template -inline GenericImageView< +[[nodiscard]] inline GenericImageView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedImageView( T *emboss_reserved_local_data, @@ -1547,92 +1481,44 @@ class GenericTwoRegionsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b_end().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b_start().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a_size().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a_start().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !region_a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !region_b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!b_end().Ok()) return false; + if (!b_start().Ok()) return false; + if (!a_size().Ok()) return false; + if (!a_start().Ok()) return false; + if (!region_a().Ok()) return false; + if (!region_b().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericTwoRegionsView emboss_reserved_local_other) const { if (!has_b_end().Known()) return false; @@ -1738,7 +1624,7 @@ class GenericTwoRegionsView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericTwoRegionsView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_b_end().ValueOr(false) && @@ -1841,7 +1727,7 @@ class GenericTwoRegionsView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericTwoRegionsView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -2126,42 +2012,42 @@ class GenericTwoRegionsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> b_end() const; - ::emboss::support::Maybe has_b_end() const; + [[nodiscard]] ::emboss::support::Maybe has_b_end() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> b_start() const; - ::emboss::support::Maybe has_b_start() const; + [[nodiscard]] ::emboss::support::Maybe has_b_start() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> a_size() const; - ::emboss::support::Maybe has_a_size() const; + [[nodiscard]] ::emboss::support::Maybe has_a_size() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> a_start() const; - ::emboss::support::Maybe has_a_start() const; + [[nodiscard]] ::emboss::support::Maybe has_a_start() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 8>> @@ -2170,10 +2056,10 @@ class GenericTwoRegionsView final { 8 > region_a() const; - ::emboss::support::Maybe has_region_a() const; + [[nodiscard]] ::emboss::support::Maybe has_region_a() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 8>> @@ -2182,7 +2068,7 @@ class GenericTwoRegionsView final { 8 > region_b() const; - ::emboss::support::Maybe has_region_b() const; + [[nodiscard]] ::emboss::support::Maybe has_region_b() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -2201,17 +2087,17 @@ class GenericTwoRegionsView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -2224,12 +2110,12 @@ class GenericTwoRegionsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.a_start(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = view_.a_size(); @@ -2248,7 +2134,7 @@ class GenericTwoRegionsView final { return emboss_reserved_local_subexpr_14; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -2256,8 +2142,8 @@ class GenericTwoRegionsView final { const GenericTwoRegionsView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -2273,9 +2159,9 @@ class GenericTwoRegionsView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2284,13 +2170,13 @@ class GenericTwoRegionsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2308,9 +2194,9 @@ class GenericTwoRegionsView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2319,13 +2205,13 @@ class GenericTwoRegionsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2356,7 +2242,7 @@ struct EmbossReservedInternalIsGenericTwoRegionsView< }; template -inline GenericTwoRegionsView< +[[nodiscard]] inline GenericTwoRegionsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2371,7 +2257,7 @@ MakeTwoRegionsView( T &&emboss_reserved_local_arg) { } template -inline GenericTwoRegionsView> +[[nodiscard]] inline GenericTwoRegionsView> MakeTwoRegionsView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericTwoRegionsView>( @@ -2380,7 +2266,7 @@ MakeTwoRegionsView( T *emboss_reserved_local_data, } template -inline GenericTwoRegionsView< +[[nodiscard]] inline GenericTwoRegionsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedTwoRegionsView( T *emboss_reserved_local_data, @@ -2447,71 +2333,41 @@ class GenericMultipliedSizeView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !width().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !height().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !data().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!width().Ok()) return false; + if (!height().Ok()) return false; + if (!data().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericMultipliedSizeView emboss_reserved_local_other) const { if (!has_width().Known()) return false; @@ -2566,7 +2422,7 @@ class GenericMultipliedSizeView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericMultipliedSizeView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_width().ValueOr(false) && @@ -2627,7 +2483,7 @@ class GenericMultipliedSizeView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericMultipliedSizeView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -2798,26 +2654,26 @@ class GenericMultipliedSizeView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> width() const; - ::emboss::support::Maybe has_width() const; + [[nodiscard]] ::emboss::support::Maybe has_width() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> height() const; - ::emboss::support::Maybe has_height() const; + [[nodiscard]] ::emboss::support::Maybe has_height() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 8>> @@ -2826,7 +2682,7 @@ class GenericMultipliedSizeView final { 8 > data() const; - ::emboss::support::Maybe has_data() const; + [[nodiscard]] ::emboss::support::Maybe has_data() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -2845,17 +2701,17 @@ class GenericMultipliedSizeView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -2868,12 +2724,12 @@ class GenericMultipliedSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.width(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = view_.height(); @@ -2886,7 +2742,7 @@ class GenericMultipliedSizeView final { return emboss_reserved_local_subexpr_8; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -2894,8 +2750,8 @@ class GenericMultipliedSizeView final { const GenericMultipliedSizeView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -2911,9 +2767,9 @@ class GenericMultipliedSizeView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2922,13 +2778,13 @@ class GenericMultipliedSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2946,9 +2802,9 @@ class GenericMultipliedSizeView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2957,13 +2813,13 @@ class GenericMultipliedSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2994,7 +2850,7 @@ struct EmbossReservedInternalIsGenericMultipliedSizeView< }; template -inline GenericMultipliedSizeView< +[[nodiscard]] inline GenericMultipliedSizeView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3009,7 +2865,7 @@ MakeMultipliedSizeView( T &&emboss_reserved_local_arg) { } template -inline GenericMultipliedSizeView> +[[nodiscard]] inline GenericMultipliedSizeView> MakeMultipliedSizeView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericMultipliedSizeView>( @@ -3018,7 +2874,7 @@ MakeMultipliedSizeView( T *emboss_reserved_local_data, } template -inline GenericMultipliedSizeView< +[[nodiscard]] inline GenericMultipliedSizeView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedMultipliedSizeView( T *emboss_reserved_local_data, @@ -3091,113 +2947,47 @@ class GenericNegativeTermsInSizesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !c().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a_minus_b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a_minus_2b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a_minus_b_minus_c().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !ten_minus_a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a_minus_2c().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a_minus_c().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a().Ok()) return false; + if (!b().Ok()) return false; + if (!c().Ok()) return false; + if (!a_minus_b().Ok()) return false; + if (!a_minus_2b().Ok()) return false; + if (!a_minus_b_minus_c().Ok()) return false; + if (!ten_minus_a().Ok()) return false; + if (!a_minus_2c().Ok()) return false; + if (!a_minus_c().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericNegativeTermsInSizesView emboss_reserved_local_other) const { if (!has_a().Known()) return false; @@ -3354,7 +3144,7 @@ class GenericNegativeTermsInSizesView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericNegativeTermsInSizesView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_a().ValueOr(false) && @@ -3499,7 +3289,7 @@ class GenericNegativeTermsInSizesView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericNegativeTermsInSizesView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -3898,34 +3688,34 @@ class GenericNegativeTermsInSizesView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> a() const; - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> b() const; - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> c() const; - ::emboss::support::Maybe has_c() const; + [[nodiscard]] ::emboss::support::Maybe has_c() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 8>> @@ -3934,10 +3724,10 @@ class GenericNegativeTermsInSizesView final { 8 > a_minus_b() const; - ::emboss::support::Maybe has_a_minus_b() const; + [[nodiscard]] ::emboss::support::Maybe has_a_minus_b() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 8>> @@ -3946,10 +3736,10 @@ class GenericNegativeTermsInSizesView final { 8 > a_minus_2b() const; - ::emboss::support::Maybe has_a_minus_2b() const; + [[nodiscard]] ::emboss::support::Maybe has_a_minus_2b() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 8>> @@ -3958,10 +3748,10 @@ class GenericNegativeTermsInSizesView final { 8 > a_minus_b_minus_c() const; - ::emboss::support::Maybe has_a_minus_b_minus_c() const; + [[nodiscard]] ::emboss::support::Maybe has_a_minus_b_minus_c() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 8>> @@ -3970,10 +3760,10 @@ class GenericNegativeTermsInSizesView final { 8 > ten_minus_a() const; - ::emboss::support::Maybe has_ten_minus_a() const; + [[nodiscard]] ::emboss::support::Maybe has_ten_minus_a() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 8>> @@ -3982,10 +3772,10 @@ class GenericNegativeTermsInSizesView final { 8 > a_minus_2c() const; - ::emboss::support::Maybe has_a_minus_2c() const; + [[nodiscard]] ::emboss::support::Maybe has_a_minus_2c() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 8>> @@ -3994,7 +3784,7 @@ class GenericNegativeTermsInSizesView final { 8 > a_minus_c() const; - ::emboss::support::Maybe has_a_minus_c() const; + [[nodiscard]] ::emboss::support::Maybe has_a_minus_c() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -4013,17 +3803,17 @@ class GenericNegativeTermsInSizesView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -4036,12 +3826,12 @@ class GenericNegativeTermsInSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.a(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = view_.b(); @@ -4078,7 +3868,7 @@ class GenericNegativeTermsInSizesView final { return emboss_reserved_local_subexpr_32; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -4086,8 +3876,8 @@ class GenericNegativeTermsInSizesView final { const GenericNegativeTermsInSizesView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -4103,9 +3893,9 @@ class GenericNegativeTermsInSizesView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4114,13 +3904,13 @@ class GenericNegativeTermsInSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4138,9 +3928,9 @@ class GenericNegativeTermsInSizesView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4149,13 +3939,13 @@ class GenericNegativeTermsInSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4186,7 +3976,7 @@ struct EmbossReservedInternalIsGenericNegativeTermsInSizesView< }; template -inline GenericNegativeTermsInSizesView< +[[nodiscard]] inline GenericNegativeTermsInSizesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4201,7 +3991,7 @@ MakeNegativeTermsInSizesView( T &&emboss_reserved_local_arg) { } template -inline GenericNegativeTermsInSizesView> +[[nodiscard]] inline GenericNegativeTermsInSizesView> MakeNegativeTermsInSizesView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericNegativeTermsInSizesView>( @@ -4210,7 +4000,7 @@ MakeNegativeTermsInSizesView( T *emboss_reserved_local_data, } template -inline GenericNegativeTermsInSizesView< +[[nodiscard]] inline GenericNegativeTermsInSizesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedNegativeTermsInSizesView( T *emboss_reserved_local_data, @@ -4276,64 +4066,40 @@ class GenericNegativeTermInLocationView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a().Ok()) return false; + if (!b().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericNegativeTermInLocationView emboss_reserved_local_other) const { if (!has_a().Known()) return false; @@ -4371,7 +4137,7 @@ class GenericNegativeTermInLocationView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericNegativeTermInLocationView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_a().ValueOr(false) && @@ -4418,7 +4184,7 @@ class GenericNegativeTermInLocationView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericNegativeTermInLocationView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -4551,23 +4317,23 @@ class GenericNegativeTermInLocationView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> a() const; - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> b() const; - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -4586,17 +4352,17 @@ class GenericNegativeTermInLocationView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -4609,12 +4375,12 @@ class GenericNegativeTermInLocationView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.a(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Difference(::emboss::support::Maybe(static_cast(10LL)), emboss_reserved_local_subexpr_2); @@ -4625,7 +4391,7 @@ class GenericNegativeTermInLocationView final { return emboss_reserved_local_subexpr_6; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -4633,8 +4399,8 @@ class GenericNegativeTermInLocationView final { const GenericNegativeTermInLocationView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -4650,9 +4416,9 @@ class GenericNegativeTermInLocationView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4661,13 +4427,13 @@ class GenericNegativeTermInLocationView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4685,9 +4451,9 @@ class GenericNegativeTermInLocationView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4696,13 +4462,13 @@ class GenericNegativeTermInLocationView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4733,7 +4499,7 @@ struct EmbossReservedInternalIsGenericNegativeTermInLocationView< }; template -inline GenericNegativeTermInLocationView< +[[nodiscard]] inline GenericNegativeTermInLocationView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4748,7 +4514,7 @@ MakeNegativeTermInLocationView( T &&emboss_reserved_local_arg) { } template -inline GenericNegativeTermInLocationView> +[[nodiscard]] inline GenericNegativeTermInLocationView> MakeNegativeTermInLocationView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericNegativeTermInLocationView>( @@ -4757,7 +4523,7 @@ MakeNegativeTermInLocationView( T *emboss_reserved_local_data, } template -inline GenericNegativeTermInLocationView< +[[nodiscard]] inline GenericNegativeTermInLocationView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedNegativeTermInLocationView( T *emboss_reserved_local_data, @@ -4825,78 +4591,42 @@ class GenericChainedSizeView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !c().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !d().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a().Ok()) return false; + if (!b().Ok()) return false; + if (!c().Ok()) return false; + if (!d().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericChainedSizeView emboss_reserved_local_other) const { if (!has_a().Known()) return false; @@ -4968,7 +4698,7 @@ class GenericChainedSizeView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericChainedSizeView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_a().ValueOr(false) && @@ -5043,7 +4773,7 @@ class GenericChainedSizeView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericChainedSizeView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -5252,39 +4982,39 @@ class GenericChainedSizeView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> a() const; - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> b() const; - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> c() const; - ::emboss::support::Maybe has_c() const; + [[nodiscard]] ::emboss::support::Maybe has_c() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> d() const; - ::emboss::support::Maybe has_d() const; + [[nodiscard]] ::emboss::support::Maybe has_d() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -5303,17 +5033,17 @@ class GenericChainedSizeView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -5326,12 +5056,12 @@ class GenericChainedSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.a(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(1LL))); @@ -5349,7 +5079,7 @@ class GenericChainedSizeView final { return emboss_reserved_local_subexpr_13; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -5357,8 +5087,8 @@ class GenericChainedSizeView final { const GenericChainedSizeView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -5374,9 +5104,9 @@ class GenericChainedSizeView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5385,13 +5115,13 @@ class GenericChainedSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5409,9 +5139,9 @@ class GenericChainedSizeView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5420,13 +5150,13 @@ class GenericChainedSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5457,7 +5187,7 @@ struct EmbossReservedInternalIsGenericChainedSizeView< }; template -inline GenericChainedSizeView< +[[nodiscard]] inline GenericChainedSizeView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5472,7 +5202,7 @@ MakeChainedSizeView( T &&emboss_reserved_local_arg) { } template -inline GenericChainedSizeView> +[[nodiscard]] inline GenericChainedSizeView> MakeChainedSizeView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericChainedSizeView>( @@ -5481,7 +5211,7 @@ MakeChainedSizeView( T *emboss_reserved_local_data, } template -inline GenericChainedSizeView< +[[nodiscard]] inline GenericChainedSizeView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedChainedSizeView( T *emboss_reserved_local_data, @@ -5548,72 +5278,42 @@ class GenericFinalFieldOverlapsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !c().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a().Ok()) return false; + if (!b().Ok()) return false; + if (!c().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericFinalFieldOverlapsView emboss_reserved_local_other) const { if (!has_a().Known()) return false; @@ -5668,7 +5368,7 @@ class GenericFinalFieldOverlapsView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericFinalFieldOverlapsView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_a().ValueOr(false) && @@ -5729,7 +5429,7 @@ class GenericFinalFieldOverlapsView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericFinalFieldOverlapsView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -5900,31 +5600,31 @@ class GenericFinalFieldOverlapsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> a() const; - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> b() const; - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<16, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 16>> c() const; - ::emboss::support::Maybe has_c() const; + [[nodiscard]] ::emboss::support::Maybe has_c() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -5940,9 +5640,9 @@ class GenericFinalFieldOverlapsView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5951,13 +5651,13 @@ class GenericFinalFieldOverlapsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5975,9 +5675,9 @@ class GenericFinalFieldOverlapsView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5986,13 +5686,13 @@ class GenericFinalFieldOverlapsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -6010,9 +5710,9 @@ class GenericFinalFieldOverlapsView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6021,13 +5721,13 @@ class GenericFinalFieldOverlapsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -6058,7 +5758,7 @@ struct EmbossReservedInternalIsGenericFinalFieldOverlapsView< }; template -inline GenericFinalFieldOverlapsView< +[[nodiscard]] inline GenericFinalFieldOverlapsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -6073,7 +5773,7 @@ MakeFinalFieldOverlapsView( T &&emboss_reserved_local_arg) { } template -inline GenericFinalFieldOverlapsView> +[[nodiscard]] inline GenericFinalFieldOverlapsView> MakeFinalFieldOverlapsView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericFinalFieldOverlapsView>( @@ -6082,7 +5782,7 @@ MakeFinalFieldOverlapsView( T *emboss_reserved_local_data, } template -inline GenericFinalFieldOverlapsView< +[[nodiscard]] inline GenericFinalFieldOverlapsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedFinalFieldOverlapsView( T *emboss_reserved_local_data, @@ -6150,78 +5850,42 @@ class GenericDynamicFinalFieldOverlapsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !c().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !d().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a().Ok()) return false; + if (!b().Ok()) return false; + if (!c().Ok()) return false; + if (!d().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericDynamicFinalFieldOverlapsView emboss_reserved_local_other) const { if (!has_a().Known()) return false; @@ -6293,7 +5957,7 @@ class GenericDynamicFinalFieldOverlapsView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericDynamicFinalFieldOverlapsView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_a().ValueOr(false) && @@ -6368,7 +6032,7 @@ class GenericDynamicFinalFieldOverlapsView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericDynamicFinalFieldOverlapsView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -6577,39 +6241,39 @@ class GenericDynamicFinalFieldOverlapsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> a() const; - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> b() const; - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<16, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 16>> c() const; - ::emboss::support::Maybe has_c() const; + [[nodiscard]] ::emboss::support::Maybe has_c() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> d() const; - ::emboss::support::Maybe has_d() const; + [[nodiscard]] ::emboss::support::Maybe has_d() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -6628,17 +6292,17 @@ class GenericDynamicFinalFieldOverlapsView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -6651,12 +6315,12 @@ class GenericDynamicFinalFieldOverlapsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.a(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(2LL))); @@ -6669,7 +6333,7 @@ class GenericDynamicFinalFieldOverlapsView final { return emboss_reserved_local_subexpr_8; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -6677,8 +6341,8 @@ class GenericDynamicFinalFieldOverlapsView final { const GenericDynamicFinalFieldOverlapsView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -6694,9 +6358,9 @@ class GenericDynamicFinalFieldOverlapsView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6705,13 +6369,13 @@ class GenericDynamicFinalFieldOverlapsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -6729,9 +6393,9 @@ class GenericDynamicFinalFieldOverlapsView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6740,13 +6404,13 @@ class GenericDynamicFinalFieldOverlapsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -6777,7 +6441,7 @@ struct EmbossReservedInternalIsGenericDynamicFinalFieldOverlapsView< }; template -inline GenericDynamicFinalFieldOverlapsView< +[[nodiscard]] inline GenericDynamicFinalFieldOverlapsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -6792,7 +6456,7 @@ MakeDynamicFinalFieldOverlapsView( T &&emboss_reserved_local_arg) { } template -inline GenericDynamicFinalFieldOverlapsView> +[[nodiscard]] inline GenericDynamicFinalFieldOverlapsView> MakeDynamicFinalFieldOverlapsView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericDynamicFinalFieldOverlapsView>( @@ -6801,7 +6465,7 @@ MakeDynamicFinalFieldOverlapsView( T *emboss_reserved_local_data, } template -inline GenericDynamicFinalFieldOverlapsView< +[[nodiscard]] inline GenericDynamicFinalFieldOverlapsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedDynamicFinalFieldOverlapsView( T *emboss_reserved_local_data, @@ -6867,64 +6531,40 @@ class GenericDynamicFieldDependsOnLaterFieldView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a().Ok()) return false; + if (!b().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericDynamicFieldDependsOnLaterFieldView emboss_reserved_local_other) const { if (!has_a().Known()) return false; @@ -6962,7 +6602,7 @@ class GenericDynamicFieldDependsOnLaterFieldView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericDynamicFieldDependsOnLaterFieldView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_a().ValueOr(false) && @@ -7009,7 +6649,7 @@ class GenericDynamicFieldDependsOnLaterFieldView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericDynamicFieldDependsOnLaterFieldView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -7142,23 +6782,23 @@ class GenericDynamicFieldDependsOnLaterFieldView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> a() const; - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> b() const; - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -7177,17 +6817,17 @@ class GenericDynamicFieldDependsOnLaterFieldView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -7200,12 +6840,12 @@ class GenericDynamicFieldDependsOnLaterFieldView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.a(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(1LL))); @@ -7216,7 +6856,7 @@ class GenericDynamicFieldDependsOnLaterFieldView final { return emboss_reserved_local_subexpr_6; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -7224,8 +6864,8 @@ class GenericDynamicFieldDependsOnLaterFieldView final { const GenericDynamicFieldDependsOnLaterFieldView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -7241,9 +6881,9 @@ class GenericDynamicFieldDependsOnLaterFieldView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -7252,13 +6892,13 @@ class GenericDynamicFieldDependsOnLaterFieldView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -7276,9 +6916,9 @@ class GenericDynamicFieldDependsOnLaterFieldView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -7287,13 +6927,13 @@ class GenericDynamicFieldDependsOnLaterFieldView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -7324,7 +6964,7 @@ struct EmbossReservedInternalIsGenericDynamicFieldDependsOnLaterFieldView< }; template -inline GenericDynamicFieldDependsOnLaterFieldView< +[[nodiscard]] inline GenericDynamicFieldDependsOnLaterFieldView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -7339,7 +6979,7 @@ MakeDynamicFieldDependsOnLaterFieldView( T &&emboss_reserved_local_arg) { } template -inline GenericDynamicFieldDependsOnLaterFieldView> +[[nodiscard]] inline GenericDynamicFieldDependsOnLaterFieldView> MakeDynamicFieldDependsOnLaterFieldView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericDynamicFieldDependsOnLaterFieldView>( @@ -7348,7 +6988,7 @@ MakeDynamicFieldDependsOnLaterFieldView( T *emboss_reserved_local_data, } template -inline GenericDynamicFieldDependsOnLaterFieldView< +[[nodiscard]] inline GenericDynamicFieldDependsOnLaterFieldView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedDynamicFieldDependsOnLaterFieldView( T *emboss_reserved_local_data, @@ -7415,72 +7055,42 @@ class GenericDynamicFieldDoesNotAffectSizeView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !c().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a().Ok()) return false; + if (!b().Ok()) return false; + if (!c().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericDynamicFieldDoesNotAffectSizeView emboss_reserved_local_other) const { if (!has_a().Known()) return false; @@ -7535,7 +7145,7 @@ class GenericDynamicFieldDoesNotAffectSizeView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericDynamicFieldDoesNotAffectSizeView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_a().ValueOr(false) && @@ -7596,7 +7206,7 @@ class GenericDynamicFieldDoesNotAffectSizeView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericDynamicFieldDoesNotAffectSizeView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -7767,31 +7377,31 @@ class GenericDynamicFieldDoesNotAffectSizeView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> a() const; - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> b() const; - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> c() const; - ::emboss::support::Maybe has_c() const; + [[nodiscard]] ::emboss::support::Maybe has_c() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -7807,9 +7417,9 @@ class GenericDynamicFieldDoesNotAffectSizeView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -7818,13 +7428,13 @@ class GenericDynamicFieldDoesNotAffectSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -7842,9 +7452,9 @@ class GenericDynamicFieldDoesNotAffectSizeView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -7853,13 +7463,13 @@ class GenericDynamicFieldDoesNotAffectSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -7877,9 +7487,9 @@ class GenericDynamicFieldDoesNotAffectSizeView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -7888,13 +7498,13 @@ class GenericDynamicFieldDoesNotAffectSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -7925,7 +7535,7 @@ struct EmbossReservedInternalIsGenericDynamicFieldDoesNotAffectSizeView< }; template -inline GenericDynamicFieldDoesNotAffectSizeView< +[[nodiscard]] inline GenericDynamicFieldDoesNotAffectSizeView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -7940,7 +7550,7 @@ MakeDynamicFieldDoesNotAffectSizeView( T &&emboss_reserved_local_arg) { } template -inline GenericDynamicFieldDoesNotAffectSizeView> +[[nodiscard]] inline GenericDynamicFieldDoesNotAffectSizeView> MakeDynamicFieldDoesNotAffectSizeView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericDynamicFieldDoesNotAffectSizeView>( @@ -7949,7 +7559,7 @@ MakeDynamicFieldDoesNotAffectSizeView( T *emboss_reserved_local_data, } template -inline GenericDynamicFieldDoesNotAffectSizeView< +[[nodiscard]] inline GenericDynamicFieldDoesNotAffectSizeView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedDynamicFieldDoesNotAffectSizeView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/enum.emb.h b/testdata/golden_cpp/enum.emb.h index 1d03fb6..ddd45bf 100644 --- a/testdata/golden_cpp/enum.emb.h +++ b/testdata/golden_cpp/enum.emb.h @@ -136,70 +136,46 @@ class GenericConstantsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !sprocket().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !geegaw().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!sprocket().Ok()) return false; + if (!geegaw().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericConstantsView emboss_reserved_local_other) const { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericConstantsView emboss_reserved_local_other) const { return true; } @@ -219,7 +195,7 @@ class GenericConstantsView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericConstantsView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -315,7 +291,7 @@ class GenericConstantsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: class EmbossReservedVirtualSprocketView final { @@ -331,9 +307,9 @@ class GenericConstantsView final { default; ~EmbossReservedVirtualSprocketView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -342,13 +318,13 @@ class GenericConstantsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedVirtualSprocketView sprocket() { + [[nodiscard]] static constexpr EmbossReservedVirtualSprocketView sprocket() { return EmbossReservedVirtualSprocketView(); } - static constexpr ::emboss::support::Maybe has_sprocket() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_sprocket() { return ::emboss::support::Maybe(true); } @@ -366,9 +342,9 @@ class GenericConstantsView final { default; ~EmbossReservedVirtualGeegawView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -377,13 +353,13 @@ class GenericConstantsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedVirtualGeegawView geegaw() { + [[nodiscard]] static constexpr EmbossReservedVirtualGeegawView geegaw() { return EmbossReservedVirtualGeegawView(); } - static constexpr ::emboss::support::Maybe has_geegaw() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_geegaw() { return ::emboss::support::Maybe(true); } @@ -401,9 +377,9 @@ class GenericConstantsView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -412,13 +388,13 @@ class GenericConstantsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -436,9 +412,9 @@ class GenericConstantsView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -447,13 +423,13 @@ class GenericConstantsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -471,9 +447,9 @@ class GenericConstantsView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -482,13 +458,13 @@ class GenericConstantsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -519,7 +495,7 @@ struct EmbossReservedInternalIsGenericConstantsView< }; template -inline GenericConstantsView< +[[nodiscard]] inline GenericConstantsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -534,7 +510,7 @@ MakeConstantsView( T &&emboss_reserved_local_arg) { } template -inline GenericConstantsView> +[[nodiscard]] inline GenericConstantsView> MakeConstantsView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericConstantsView>( @@ -543,7 +519,7 @@ MakeConstantsView( T *emboss_reserved_local_data, } template -inline GenericConstantsView< +[[nodiscard]] inline GenericConstantsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConstantsView( T *emboss_reserved_local_data, @@ -1559,58 +1535,40 @@ class GenericEmbossReservedAnonymousField1View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !wide_kind_in_bits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!wide_kind_in_bits().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { if (!has_wide_kind_in_bits().Known()) return false; @@ -1631,7 +1589,7 @@ class GenericEmbossReservedAnonymousField1View final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_wide_kind_in_bits().ValueOr(false) && @@ -1664,7 +1622,7 @@ class GenericEmbossReservedAnonymousField1View final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1759,16 +1717,16 @@ class GenericEmbossReservedAnonymousField1View final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::Kind, ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> wide_kind_in_bits() const; - ::emboss::support::Maybe has_wide_kind_in_bits() const; + [[nodiscard]] ::emboss::support::Maybe has_wide_kind_in_bits() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -1784,9 +1742,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1795,13 +1753,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1819,9 +1777,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1830,13 +1788,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1854,9 +1812,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1865,13 +1823,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1902,7 +1860,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField1View< }; template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1917,7 +1875,7 @@ MakeEmbossReservedAnonymousField1View( T &&emboss_reserved_local_arg) { } template -inline GenericEmbossReservedAnonymousField1View> +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View> MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericEmbossReservedAnonymousField1View>( @@ -1926,7 +1884,7 @@ MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, @@ -1987,86 +1945,51 @@ class GenericManifestEntryView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !kind().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !count().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !wide_kind().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !wide_kind_in_bits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!kind().Ok()) return false; + if (!count().Ok()) return false; + if (!wide_kind().Ok()) return false; + if (!emboss_reserved_anonymous_field_1().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!wide_kind_in_bits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericManifestEntryView emboss_reserved_local_other) const { if (!has_kind().Known()) return false; @@ -2138,7 +2061,7 @@ class GenericManifestEntryView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericManifestEntryView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_kind().ValueOr(false) && @@ -2213,7 +2136,7 @@ class GenericManifestEntryView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericManifestEntryView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -2422,46 +2345,46 @@ class GenericManifestEntryView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::Kind, ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> kind() const; - ::emboss::support::Maybe has_kind() const; + [[nodiscard]] ::emboss::support::Maybe has_kind() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> count() const; - ::emboss::support::Maybe has_count() const; + [[nodiscard]] ::emboss::support::Maybe has_count() const; public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::Kind, ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> wide_kind() const; - ::emboss::support::Maybe has_wide_kind() const; + [[nodiscard]] ::emboss::support::Maybe has_wide_kind() const; private: - typename ::emboss::test::ManifestEntry::GenericEmbossReservedAnonymousField1View>, 40>> + [[nodiscard]] typename ::emboss::test::ManifestEntry::GenericEmbossReservedAnonymousField1View>, 40>> emboss_reserved_anonymous_field_1() const; - ::emboss::support::Maybe has_emboss_reserved_anonymous_field_1() const; + [[nodiscard]] ::emboss::support::Maybe has_emboss_reserved_anonymous_field_1() const; public: - auto wide_kind_in_bits() const -> decltype(this->emboss_reserved_anonymous_field_1().wide_kind_in_bits()) { + [[nodiscard]] auto wide_kind_in_bits() const -> decltype(this->emboss_reserved_anonymous_field_1().wide_kind_in_bits()) { return has_wide_kind_in_bits().ValueOrDefault() ? emboss_reserved_anonymous_field_1().wide_kind_in_bits() : decltype(this->emboss_reserved_anonymous_field_1().wide_kind_in_bits())(); } - ::emboss::support::Maybe has_wide_kind_in_bits() const; + [[nodiscard]] ::emboss::support::Maybe has_wide_kind_in_bits() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -2477,9 +2400,9 @@ class GenericManifestEntryView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2488,13 +2411,13 @@ class GenericManifestEntryView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2512,9 +2435,9 @@ class GenericManifestEntryView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2523,13 +2446,13 @@ class GenericManifestEntryView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2547,9 +2470,9 @@ class GenericManifestEntryView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2558,13 +2481,13 @@ class GenericManifestEntryView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2595,7 +2518,7 @@ struct EmbossReservedInternalIsGenericManifestEntryView< }; template -inline GenericManifestEntryView< +[[nodiscard]] inline GenericManifestEntryView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2610,7 +2533,7 @@ MakeManifestEntryView( T &&emboss_reserved_local_arg) { } template -inline GenericManifestEntryView> +[[nodiscard]] inline GenericManifestEntryView> MakeManifestEntryView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericManifestEntryView>( @@ -2619,7 +2542,7 @@ MakeManifestEntryView( T *emboss_reserved_local_data, } template -inline GenericManifestEntryView< +[[nodiscard]] inline GenericManifestEntryView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedManifestEntryView( T *emboss_reserved_local_data, @@ -2771,58 +2694,40 @@ class GenericStructContainingEnumView final { using Status = ::emboss::test::StructContainingEnum::Status; - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !bar().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!bar().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericStructContainingEnumView emboss_reserved_local_other) const { if (!has_bar().Known()) return false; @@ -2843,7 +2748,7 @@ class GenericStructContainingEnumView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericStructContainingEnumView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_bar().ValueOr(false) && @@ -2876,7 +2781,7 @@ class GenericStructContainingEnumView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericStructContainingEnumView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -2971,15 +2876,15 @@ class GenericStructContainingEnumView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> bar() const; - ::emboss::support::Maybe has_bar() const; + [[nodiscard]] ::emboss::support::Maybe has_bar() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -2995,9 +2900,9 @@ class GenericStructContainingEnumView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3006,13 +2911,13 @@ class GenericStructContainingEnumView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3030,9 +2935,9 @@ class GenericStructContainingEnumView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3041,13 +2946,13 @@ class GenericStructContainingEnumView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3065,9 +2970,9 @@ class GenericStructContainingEnumView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3076,13 +2981,13 @@ class GenericStructContainingEnumView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3113,7 +3018,7 @@ struct EmbossReservedInternalIsGenericStructContainingEnumView< }; template -inline GenericStructContainingEnumView< +[[nodiscard]] inline GenericStructContainingEnumView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3128,7 +3033,7 @@ MakeStructContainingEnumView( T &&emboss_reserved_local_arg) { } template -inline GenericStructContainingEnumView> +[[nodiscard]] inline GenericStructContainingEnumView> MakeStructContainingEnumView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericStructContainingEnumView>( @@ -3137,7 +3042,7 @@ MakeStructContainingEnumView( T *emboss_reserved_local_data, } template -inline GenericStructContainingEnumView< +[[nodiscard]] inline GenericStructContainingEnumView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructContainingEnumView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/enum_case.emb.h b/testdata/golden_cpp/enum_case.emb.h index 4d6c432..6ef116a 100644 --- a/testdata/golden_cpp/enum_case.emb.h +++ b/testdata/golden_cpp/enum_case.emb.h @@ -331,72 +331,42 @@ class GenericUseKCamelEnumCaseView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !v().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !first().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !v_is_first().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!v().Ok()) return false; + if (!first().Ok()) return false; + if (!v_is_first().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericUseKCamelEnumCaseView emboss_reserved_local_other) const { if (!has_v().Known()) return false; @@ -417,7 +387,7 @@ class GenericUseKCamelEnumCaseView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericUseKCamelEnumCaseView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_v().ValueOr(false) && @@ -450,7 +420,7 @@ class GenericUseKCamelEnumCaseView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericUseKCamelEnumCaseView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -583,16 +553,16 @@ class GenericUseKCamelEnumCaseView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::EnumDefault, ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> v() const; - ::emboss::support::Maybe has_v() const; + [[nodiscard]] ::emboss::support::Maybe has_v() const; public: class EmbossReservedVirtualFirstView final { @@ -608,9 +578,9 @@ class GenericUseKCamelEnumCaseView final { default; ~EmbossReservedVirtualFirstView() = default; - static constexpr ::emboss::test::EnumDefault Read(); - static constexpr ::emboss::test::EnumDefault UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::emboss::test::EnumDefault Read(); + [[nodiscard]] static constexpr ::emboss::test::EnumDefault UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -619,13 +589,13 @@ class GenericUseKCamelEnumCaseView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedVirtualFirstView first() { + [[nodiscard]] static constexpr EmbossReservedVirtualFirstView first() { return EmbossReservedVirtualFirstView(); } - static constexpr ::emboss::support::Maybe has_first() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_first() { return ::emboss::support::Maybe(true); } @@ -646,17 +616,17 @@ class GenericUseKCamelEnumCaseView final { default; ~EmbossReservedVirtualVIsFirstView() = default; - bool Read() const { + [[nodiscard]] bool Read() const { EMBOSS_CHECK(view_.has_v_is_first().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - bool UncheckedRead() const { + [[nodiscard]] bool UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -669,12 +639,12 @@ class GenericUseKCamelEnumCaseView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.v(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(0))); @@ -682,7 +652,7 @@ class GenericUseKCamelEnumCaseView final { return emboss_reserved_local_subexpr_3; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( bool emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -690,8 +660,8 @@ class GenericUseKCamelEnumCaseView final { const GenericUseKCamelEnumCaseView view_; }; - EmbossReservedVirtualVIsFirstView v_is_first() const; - ::emboss::support::Maybe has_v_is_first() const; + [[nodiscard]] EmbossReservedVirtualVIsFirstView v_is_first() const; + [[nodiscard]] ::emboss::support::Maybe has_v_is_first() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -707,9 +677,9 @@ class GenericUseKCamelEnumCaseView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -718,13 +688,13 @@ class GenericUseKCamelEnumCaseView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -742,9 +712,9 @@ class GenericUseKCamelEnumCaseView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -753,13 +723,13 @@ class GenericUseKCamelEnumCaseView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -777,9 +747,9 @@ class GenericUseKCamelEnumCaseView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -788,13 +758,13 @@ class GenericUseKCamelEnumCaseView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -825,7 +795,7 @@ struct EmbossReservedInternalIsGenericUseKCamelEnumCaseView< }; template -inline GenericUseKCamelEnumCaseView< +[[nodiscard]] inline GenericUseKCamelEnumCaseView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -840,7 +810,7 @@ MakeUseKCamelEnumCaseView( T &&emboss_reserved_local_arg) { } template -inline GenericUseKCamelEnumCaseView> +[[nodiscard]] inline GenericUseKCamelEnumCaseView> MakeUseKCamelEnumCaseView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericUseKCamelEnumCaseView>( @@ -849,7 +819,7 @@ MakeUseKCamelEnumCaseView( T *emboss_reserved_local_data, } template -inline GenericUseKCamelEnumCaseView< +[[nodiscard]] inline GenericUseKCamelEnumCaseView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedUseKCamelEnumCaseView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/explicit_sizes.emb.h b/testdata/golden_cpp/explicit_sizes.emb.h index 8005e47..566dcf7 100644 --- a/testdata/golden_cpp/explicit_sizes.emb.h +++ b/testdata/golden_cpp/explicit_sizes.emb.h @@ -115,72 +115,42 @@ class GenericSizedUIntArraysView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !one_nibble().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !two_nibble().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !four_nibble().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!one_nibble().Ok()) return false; + if (!two_nibble().Ok()) return false; + if (!four_nibble().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericSizedUIntArraysView emboss_reserved_local_other) const { if (!has_one_nibble().Known()) return false; @@ -235,7 +205,7 @@ class GenericSizedUIntArraysView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericSizedUIntArraysView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_one_nibble().ValueOr(false) && @@ -296,7 +266,7 @@ class GenericSizedUIntArraysView final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericSizedUIntArraysView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -467,10 +437,10 @@ class GenericSizedUIntArraysView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<4, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType::template OffsetStorageType> @@ -479,10 +449,10 @@ class GenericSizedUIntArraysView final { 1 > one_nibble() const; - ::emboss::support::Maybe has_one_nibble() const; + [[nodiscard]] ::emboss::support::Maybe has_one_nibble() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType::template OffsetStorageType> @@ -491,10 +461,10 @@ class GenericSizedUIntArraysView final { 1 > two_nibble() const; - ::emboss::support::Maybe has_two_nibble() const; + [[nodiscard]] ::emboss::support::Maybe has_two_nibble() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<16, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType::template OffsetStorageType> @@ -503,7 +473,7 @@ class GenericSizedUIntArraysView final { 1 > four_nibble() const; - ::emboss::support::Maybe has_four_nibble() const; + [[nodiscard]] ::emboss::support::Maybe has_four_nibble() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -519,9 +489,9 @@ class GenericSizedUIntArraysView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -530,13 +500,13 @@ class GenericSizedUIntArraysView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -554,9 +524,9 @@ class GenericSizedUIntArraysView final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -565,13 +535,13 @@ class GenericSizedUIntArraysView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -589,9 +559,9 @@ class GenericSizedUIntArraysView final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -600,13 +570,13 @@ class GenericSizedUIntArraysView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -637,7 +607,7 @@ struct EmbossReservedInternalIsGenericSizedUIntArraysView< }; template -inline GenericSizedUIntArraysView< +[[nodiscard]] inline GenericSizedUIntArraysView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -652,7 +622,7 @@ MakeSizedUIntArraysView( T &&emboss_reserved_local_arg) { } template -inline GenericSizedUIntArraysView> +[[nodiscard]] inline GenericSizedUIntArraysView> MakeSizedUIntArraysView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericSizedUIntArraysView>( @@ -661,7 +631,7 @@ MakeSizedUIntArraysView( T *emboss_reserved_local_data, } template -inline GenericSizedUIntArraysView< +[[nodiscard]] inline GenericSizedUIntArraysView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedSizedUIntArraysView( T *emboss_reserved_local_data, @@ -728,72 +698,42 @@ class GenericSizedIntArraysView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !one_nibble().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !two_nibble().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !four_nibble().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!one_nibble().Ok()) return false; + if (!two_nibble().Ok()) return false; + if (!four_nibble().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericSizedIntArraysView emboss_reserved_local_other) const { if (!has_one_nibble().Known()) return false; @@ -848,7 +788,7 @@ class GenericSizedIntArraysView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericSizedIntArraysView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_one_nibble().ValueOr(false) && @@ -909,7 +849,7 @@ class GenericSizedIntArraysView final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericSizedIntArraysView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1080,10 +1020,10 @@ class GenericSizedIntArraysView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<4, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType::template OffsetStorageType> @@ -1092,10 +1032,10 @@ class GenericSizedIntArraysView final { 1 > one_nibble() const; - ::emboss::support::Maybe has_one_nibble() const; + [[nodiscard]] ::emboss::support::Maybe has_one_nibble() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType::template OffsetStorageType> @@ -1104,10 +1044,10 @@ class GenericSizedIntArraysView final { 1 > two_nibble() const; - ::emboss::support::Maybe has_two_nibble() const; + [[nodiscard]] ::emboss::support::Maybe has_two_nibble() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<16, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType::template OffsetStorageType> @@ -1116,7 +1056,7 @@ class GenericSizedIntArraysView final { 1 > four_nibble() const; - ::emboss::support::Maybe has_four_nibble() const; + [[nodiscard]] ::emboss::support::Maybe has_four_nibble() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -1132,9 +1072,9 @@ class GenericSizedIntArraysView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1143,13 +1083,13 @@ class GenericSizedIntArraysView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1167,9 +1107,9 @@ class GenericSizedIntArraysView final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1178,13 +1118,13 @@ class GenericSizedIntArraysView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1202,9 +1142,9 @@ class GenericSizedIntArraysView final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1213,13 +1153,13 @@ class GenericSizedIntArraysView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1250,7 +1190,7 @@ struct EmbossReservedInternalIsGenericSizedIntArraysView< }; template -inline GenericSizedIntArraysView< +[[nodiscard]] inline GenericSizedIntArraysView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1265,7 +1205,7 @@ MakeSizedIntArraysView( T &&emboss_reserved_local_arg) { } template -inline GenericSizedIntArraysView> +[[nodiscard]] inline GenericSizedIntArraysView> MakeSizedIntArraysView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericSizedIntArraysView>( @@ -1274,7 +1214,7 @@ MakeSizedIntArraysView( T *emboss_reserved_local_data, } template -inline GenericSizedIntArraysView< +[[nodiscard]] inline GenericSizedIntArraysView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedSizedIntArraysView( T *emboss_reserved_local_data, @@ -1341,72 +1281,42 @@ class GenericSizedEnumArraysView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !one_nibble().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !two_nibble().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !four_nibble().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!one_nibble().Ok()) return false; + if (!two_nibble().Ok()) return false; + if (!four_nibble().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericSizedEnumArraysView emboss_reserved_local_other) const { if (!has_one_nibble().Known()) return false; @@ -1461,7 +1371,7 @@ class GenericSizedEnumArraysView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericSizedEnumArraysView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_one_nibble().ValueOr(false) && @@ -1522,7 +1432,7 @@ class GenericSizedEnumArraysView final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericSizedEnumArraysView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1693,10 +1603,10 @@ class GenericSizedEnumArraysView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::support::EnumView< /**/ ::emboss::test::Enum, ::emboss::support::FixedSizeViewParameters<4, ::emboss::support::AllValuesAreOk>, @@ -1706,10 +1616,10 @@ class GenericSizedEnumArraysView final { 1 > one_nibble() const; - ::emboss::support::Maybe has_one_nibble() const; + [[nodiscard]] ::emboss::support::Maybe has_one_nibble() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::support::EnumView< /**/ ::emboss::test::Enum, ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, @@ -1719,10 +1629,10 @@ class GenericSizedEnumArraysView final { 1 > two_nibble() const; - ::emboss::support::Maybe has_two_nibble() const; + [[nodiscard]] ::emboss::support::Maybe has_two_nibble() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::support::EnumView< /**/ ::emboss::test::Enum, ::emboss::support::FixedSizeViewParameters<16, ::emboss::support::AllValuesAreOk>, @@ -1732,7 +1642,7 @@ class GenericSizedEnumArraysView final { 1 > four_nibble() const; - ::emboss::support::Maybe has_four_nibble() const; + [[nodiscard]] ::emboss::support::Maybe has_four_nibble() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -1748,9 +1658,9 @@ class GenericSizedEnumArraysView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1759,13 +1669,13 @@ class GenericSizedEnumArraysView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1783,9 +1693,9 @@ class GenericSizedEnumArraysView final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1794,13 +1704,13 @@ class GenericSizedEnumArraysView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1818,9 +1728,9 @@ class GenericSizedEnumArraysView final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1829,13 +1739,13 @@ class GenericSizedEnumArraysView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1866,7 +1776,7 @@ struct EmbossReservedInternalIsGenericSizedEnumArraysView< }; template -inline GenericSizedEnumArraysView< +[[nodiscard]] inline GenericSizedEnumArraysView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1881,7 +1791,7 @@ MakeSizedEnumArraysView( T &&emboss_reserved_local_arg) { } template -inline GenericSizedEnumArraysView> +[[nodiscard]] inline GenericSizedEnumArraysView> MakeSizedEnumArraysView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericSizedEnumArraysView>( @@ -1890,7 +1800,7 @@ MakeSizedEnumArraysView( T *emboss_reserved_local_data, } template -inline GenericSizedEnumArraysView< +[[nodiscard]] inline GenericSizedEnumArraysView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedSizedEnumArraysView( T *emboss_reserved_local_data, @@ -1955,58 +1865,40 @@ class GenericBitArrayContainerView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !uint_arrays().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!uint_arrays().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericBitArrayContainerView emboss_reserved_local_other) const { if (!has_uint_arrays().Known()) return false; @@ -2027,7 +1919,7 @@ class GenericBitArrayContainerView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericBitArrayContainerView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_uint_arrays().ValueOr(false) && @@ -2060,7 +1952,7 @@ class GenericBitArrayContainerView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericBitArrayContainerView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -2155,13 +2047,13 @@ class GenericBitArrayContainerView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::test::GenericSizedUIntArraysView>, 56>> + [[nodiscard]] typename ::emboss::test::GenericSizedUIntArraysView>, 56>> uint_arrays() const; - ::emboss::support::Maybe has_uint_arrays() const; + [[nodiscard]] ::emboss::support::Maybe has_uint_arrays() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -2177,9 +2069,9 @@ class GenericBitArrayContainerView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2188,13 +2080,13 @@ class GenericBitArrayContainerView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2212,9 +2104,9 @@ class GenericBitArrayContainerView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2223,13 +2115,13 @@ class GenericBitArrayContainerView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2247,9 +2139,9 @@ class GenericBitArrayContainerView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2258,13 +2150,13 @@ class GenericBitArrayContainerView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2295,7 +2187,7 @@ struct EmbossReservedInternalIsGenericBitArrayContainerView< }; template -inline GenericBitArrayContainerView< +[[nodiscard]] inline GenericBitArrayContainerView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2310,7 +2202,7 @@ MakeBitArrayContainerView( T &&emboss_reserved_local_arg) { } template -inline GenericBitArrayContainerView> +[[nodiscard]] inline GenericBitArrayContainerView> MakeBitArrayContainerView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericBitArrayContainerView>( @@ -2319,7 +2211,7 @@ MakeBitArrayContainerView( T *emboss_reserved_local_data, } template -inline GenericBitArrayContainerView< +[[nodiscard]] inline GenericBitArrayContainerView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedBitArrayContainerView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/float.emb.h b/testdata/golden_cpp/float.emb.h index c54aa66..1e5e869 100644 --- a/testdata/golden_cpp/float.emb.h +++ b/testdata/golden_cpp/float.emb.h @@ -96,65 +96,41 @@ class GenericFloatsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !float_little_endian().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !float_big_endian().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!float_little_endian().Ok()) return false; + if (!float_big_endian().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericFloatsView emboss_reserved_local_other) const { if (!has_float_little_endian().Known()) return false; @@ -192,7 +168,7 @@ class GenericFloatsView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericFloatsView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_float_little_endian().ValueOr(false) && @@ -239,7 +215,7 @@ class GenericFloatsView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericFloatsView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -372,23 +348,23 @@ class GenericFloatsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::FloatView< + [[nodiscard]] typename ::emboss::prelude::FloatView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> float_little_endian() const; - ::emboss::support::Maybe has_float_little_endian() const; + [[nodiscard]] ::emboss::support::Maybe has_float_little_endian() const; public: - typename ::emboss::prelude::FloatView< + [[nodiscard]] typename ::emboss::prelude::FloatView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> float_big_endian() const; - ::emboss::support::Maybe has_float_big_endian() const; + [[nodiscard]] ::emboss::support::Maybe has_float_big_endian() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -404,9 +380,9 @@ class GenericFloatsView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -415,13 +391,13 @@ class GenericFloatsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -439,9 +415,9 @@ class GenericFloatsView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -450,13 +426,13 @@ class GenericFloatsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -474,9 +450,9 @@ class GenericFloatsView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -485,13 +461,13 @@ class GenericFloatsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -522,7 +498,7 @@ struct EmbossReservedInternalIsGenericFloatsView< }; template -inline GenericFloatsView< +[[nodiscard]] inline GenericFloatsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -537,7 +513,7 @@ MakeFloatsView( T &&emboss_reserved_local_arg) { } template -inline GenericFloatsView> +[[nodiscard]] inline GenericFloatsView> MakeFloatsView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericFloatsView>( @@ -546,7 +522,7 @@ MakeFloatsView( T *emboss_reserved_local_data, } template -inline GenericFloatsView< +[[nodiscard]] inline GenericFloatsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedFloatsView( T *emboss_reserved_local_data, @@ -612,65 +588,41 @@ class GenericDoublesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !double_little_endian().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !double_big_endian().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!double_little_endian().Ok()) return false; + if (!double_big_endian().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericDoublesView emboss_reserved_local_other) const { if (!has_double_little_endian().Known()) return false; @@ -708,7 +660,7 @@ class GenericDoublesView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericDoublesView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_double_little_endian().ValueOr(false) && @@ -755,7 +707,7 @@ class GenericDoublesView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericDoublesView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -888,23 +840,23 @@ class GenericDoublesView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::FloatView< + [[nodiscard]] typename ::emboss::prelude::FloatView< /**/ ::emboss::support::FixedSizeViewParameters<64, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 64>> double_little_endian() const; - ::emboss::support::Maybe has_double_little_endian() const; + [[nodiscard]] ::emboss::support::Maybe has_double_little_endian() const; public: - typename ::emboss::prelude::FloatView< + [[nodiscard]] typename ::emboss::prelude::FloatView< /**/ ::emboss::support::FixedSizeViewParameters<64, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 64>> double_big_endian() const; - ::emboss::support::Maybe has_double_big_endian() const; + [[nodiscard]] ::emboss::support::Maybe has_double_big_endian() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -920,9 +872,9 @@ class GenericDoublesView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -931,13 +883,13 @@ class GenericDoublesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -955,9 +907,9 @@ class GenericDoublesView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -966,13 +918,13 @@ class GenericDoublesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -990,9 +942,9 @@ class GenericDoublesView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1001,13 +953,13 @@ class GenericDoublesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1038,7 +990,7 @@ struct EmbossReservedInternalIsGenericDoublesView< }; template -inline GenericDoublesView< +[[nodiscard]] inline GenericDoublesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1053,7 +1005,7 @@ MakeDoublesView( T &&emboss_reserved_local_arg) { } template -inline GenericDoublesView> +[[nodiscard]] inline GenericDoublesView> MakeDoublesView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericDoublesView>( @@ -1062,7 +1014,7 @@ MakeDoublesView( T *emboss_reserved_local_data, } template -inline GenericDoublesView< +[[nodiscard]] inline GenericDoublesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedDoublesView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/imported.emb.h b/testdata/golden_cpp/imported.emb.h index ce0cbea..840712a 100644 --- a/testdata/golden_cpp/imported.emb.h +++ b/testdata/golden_cpp/imported.emb.h @@ -87,58 +87,40 @@ class GenericInnerView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !value().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!value().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericInnerView emboss_reserved_local_other) const { if (!has_value().Known()) return false; @@ -159,7 +141,7 @@ class GenericInnerView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericInnerView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_value().ValueOr(false) && @@ -192,7 +174,7 @@ class GenericInnerView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericInnerView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -287,15 +269,15 @@ class GenericInnerView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<64, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 64>> value() const; - ::emboss::support::Maybe has_value() const; + [[nodiscard]] ::emboss::support::Maybe has_value() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -311,9 +293,9 @@ class GenericInnerView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -322,13 +304,13 @@ class GenericInnerView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -346,9 +328,9 @@ class GenericInnerView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -357,13 +339,13 @@ class GenericInnerView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -381,9 +363,9 @@ class GenericInnerView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -392,13 +374,13 @@ class GenericInnerView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -429,7 +411,7 @@ struct EmbossReservedInternalIsGenericInnerView< }; template -inline GenericInnerView< +[[nodiscard]] inline GenericInnerView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -444,7 +426,7 @@ MakeInnerView( T &&emboss_reserved_local_arg) { } template -inline GenericInnerView> +[[nodiscard]] inline GenericInnerView> MakeInnerView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericInnerView>( @@ -453,7 +435,7 @@ MakeInnerView( T *emboss_reserved_local_data, } template -inline GenericInnerView< +[[nodiscard]] inline GenericInnerView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedInnerView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/imported_genfiles.emb.h b/testdata/golden_cpp/imported_genfiles.emb.h index eb26bc9..cc5384f 100644 --- a/testdata/golden_cpp/imported_genfiles.emb.h +++ b/testdata/golden_cpp/imported_genfiles.emb.h @@ -88,58 +88,40 @@ class GenericInnerView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !value().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!value().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericInnerView emboss_reserved_local_other) const { if (!has_value().Known()) return false; @@ -160,7 +142,7 @@ class GenericInnerView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericInnerView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_value().ValueOr(false) && @@ -193,7 +175,7 @@ class GenericInnerView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericInnerView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -288,15 +270,15 @@ class GenericInnerView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<64, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 64>> value() const; - ::emboss::support::Maybe has_value() const; + [[nodiscard]] ::emboss::support::Maybe has_value() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -312,9 +294,9 @@ class GenericInnerView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -323,13 +305,13 @@ class GenericInnerView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -347,9 +329,9 @@ class GenericInnerView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -358,13 +340,13 @@ class GenericInnerView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -382,9 +364,9 @@ class GenericInnerView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -393,13 +375,13 @@ class GenericInnerView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -430,7 +412,7 @@ struct EmbossReservedInternalIsGenericInnerView< }; template -inline GenericInnerView< +[[nodiscard]] inline GenericInnerView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -445,7 +427,7 @@ MakeInnerView( T &&emboss_reserved_local_arg) { } template -inline GenericInnerView> +[[nodiscard]] inline GenericInnerView> MakeInnerView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericInnerView>( @@ -454,7 +436,7 @@ MakeInnerView( T *emboss_reserved_local_data, } template -inline GenericInnerView< +[[nodiscard]] inline GenericInnerView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedInnerView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/importer.emb.h b/testdata/golden_cpp/importer.emb.h index 3c54911..f209c6c 100644 --- a/testdata/golden_cpp/importer.emb.h +++ b/testdata/golden_cpp/importer.emb.h @@ -92,65 +92,41 @@ class GenericOuterView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !inner().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !inner_gen().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!inner().Ok()) return false; + if (!inner_gen().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericOuterView emboss_reserved_local_other) const { if (!has_inner().Known()) return false; @@ -188,7 +164,7 @@ class GenericOuterView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericOuterView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_inner().ValueOr(false) && @@ -235,7 +211,7 @@ class GenericOuterView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericOuterView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -368,19 +344,19 @@ class GenericOuterView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::test::GenericInnerView> + [[nodiscard]] typename ::emboss::test::GenericInnerView> inner() const; - ::emboss::support::Maybe has_inner() const; + [[nodiscard]] ::emboss::support::Maybe has_inner() const; public: - typename ::emboss::test::generated::GenericInnerView> + [[nodiscard]] typename ::emboss::test::generated::GenericInnerView> inner_gen() const; - ::emboss::support::Maybe has_inner_gen() const; + [[nodiscard]] ::emboss::support::Maybe has_inner_gen() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -396,9 +372,9 @@ class GenericOuterView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -407,13 +383,13 @@ class GenericOuterView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -431,9 +407,9 @@ class GenericOuterView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -442,13 +418,13 @@ class GenericOuterView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -466,9 +442,9 @@ class GenericOuterView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -477,13 +453,13 @@ class GenericOuterView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -514,7 +490,7 @@ struct EmbossReservedInternalIsGenericOuterView< }; template -inline GenericOuterView< +[[nodiscard]] inline GenericOuterView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -529,7 +505,7 @@ MakeOuterView( T &&emboss_reserved_local_arg) { } template -inline GenericOuterView> +[[nodiscard]] inline GenericOuterView> MakeOuterView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericOuterView>( @@ -538,7 +514,7 @@ MakeOuterView( T *emboss_reserved_local_data, } template -inline GenericOuterView< +[[nodiscard]] inline GenericOuterView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedOuterView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/importer2.emb.h b/testdata/golden_cpp/importer2.emb.h index 8b99ad6..b4107d1 100644 --- a/testdata/golden_cpp/importer2.emb.h +++ b/testdata/golden_cpp/importer2.emb.h @@ -89,58 +89,40 @@ class GenericOuter2View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !outer().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!outer().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericOuter2View emboss_reserved_local_other) const { if (!has_outer().Known()) return false; @@ -161,7 +143,7 @@ class GenericOuter2View final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericOuter2View emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_outer().ValueOr(false) && @@ -194,7 +176,7 @@ class GenericOuter2View final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericOuter2View emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -289,13 +271,13 @@ class GenericOuter2View final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::test::GenericOuterView> + [[nodiscard]] typename ::emboss::test::GenericOuterView> outer() const; - ::emboss::support::Maybe has_outer() const; + [[nodiscard]] ::emboss::support::Maybe has_outer() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -311,9 +293,9 @@ class GenericOuter2View final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -322,13 +304,13 @@ class GenericOuter2View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -346,9 +328,9 @@ class GenericOuter2View final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -357,13 +339,13 @@ class GenericOuter2View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -381,9 +363,9 @@ class GenericOuter2View final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -392,13 +374,13 @@ class GenericOuter2View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -429,7 +411,7 @@ struct EmbossReservedInternalIsGenericOuter2View< }; template -inline GenericOuter2View< +[[nodiscard]] inline GenericOuter2View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -444,7 +426,7 @@ MakeOuter2View( T &&emboss_reserved_local_arg) { } template -inline GenericOuter2View> +[[nodiscard]] inline GenericOuter2View> MakeOuter2View( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericOuter2View>( @@ -453,7 +435,7 @@ MakeOuter2View( T *emboss_reserved_local_data, } template -inline GenericOuter2View< +[[nodiscard]] inline GenericOuter2View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedOuter2View( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/inline_type.emb.h b/testdata/golden_cpp/inline_type.emb.h index 0adbce3..f55d002 100644 --- a/testdata/golden_cpp/inline_type.emb.h +++ b/testdata/golden_cpp/inline_type.emb.h @@ -269,65 +269,41 @@ class GenericFooView final { using Status = ::emboss::test::Foo::Status; using SecondaryStatus = ::emboss::test::Foo::SecondaryStatus; - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !status().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !secondary_status().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!status().Ok()) return false; + if (!secondary_status().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericFooView emboss_reserved_local_other) const { if (!has_status().Known()) return false; @@ -365,7 +341,7 @@ class GenericFooView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericFooView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_status().ValueOr(false) && @@ -412,7 +388,7 @@ class GenericFooView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericFooView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -545,25 +521,25 @@ class GenericFooView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::Foo::Status, ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> status() const; - ::emboss::support::Maybe has_status() const; + [[nodiscard]] ::emboss::support::Maybe has_status() const; public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::Foo::SecondaryStatus, ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> secondary_status() const; - ::emboss::support::Maybe has_secondary_status() const; + [[nodiscard]] ::emboss::support::Maybe has_secondary_status() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -579,9 +555,9 @@ class GenericFooView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -590,13 +566,13 @@ class GenericFooView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -614,9 +590,9 @@ class GenericFooView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -625,13 +601,13 @@ class GenericFooView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -649,9 +625,9 @@ class GenericFooView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -660,13 +636,13 @@ class GenericFooView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -697,7 +673,7 @@ struct EmbossReservedInternalIsGenericFooView< }; template -inline GenericFooView< +[[nodiscard]] inline GenericFooView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -712,7 +688,7 @@ MakeFooView( T &&emboss_reserved_local_arg) { } template -inline GenericFooView> +[[nodiscard]] inline GenericFooView> MakeFooView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericFooView>( @@ -721,7 +697,7 @@ MakeFooView( T *emboss_reserved_local_data, } template -inline GenericFooView< +[[nodiscard]] inline GenericFooView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedFooView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/int_sizes.emb.h b/testdata/golden_cpp/int_sizes.emb.h index ddb7e4d..956706f 100644 --- a/testdata/golden_cpp/int_sizes.emb.h +++ b/testdata/golden_cpp/int_sizes.emb.h @@ -94,107 +94,47 @@ class GenericSizesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !two_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !three_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !four_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !five_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !six_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !seven_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !eight_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!one_byte().Ok()) return false; + if (!two_byte().Ok()) return false; + if (!three_byte().Ok()) return false; + if (!four_byte().Ok()) return false; + if (!five_byte().Ok()) return false; + if (!six_byte().Ok()) return false; + if (!seven_byte().Ok()) return false; + if (!eight_byte().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericSizesView emboss_reserved_local_other) const { if (!has_one_byte().Known()) return false; @@ -334,7 +274,7 @@ class GenericSizesView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericSizesView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_one_byte().ValueOr(false) && @@ -465,7 +405,7 @@ class GenericSizesView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericSizesView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -826,71 +766,71 @@ class GenericSizesView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::IntView< + [[nodiscard]] typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> one_byte() const; - ::emboss::support::Maybe has_one_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_one_byte() const; public: - typename ::emboss::prelude::IntView< + [[nodiscard]] typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<16, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 16>> two_byte() const; - ::emboss::support::Maybe has_two_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_two_byte() const; public: - typename ::emboss::prelude::IntView< + [[nodiscard]] typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<24, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 24>> three_byte() const; - ::emboss::support::Maybe has_three_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_three_byte() const; public: - typename ::emboss::prelude::IntView< + [[nodiscard]] typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> four_byte() const; - ::emboss::support::Maybe has_four_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_four_byte() const; public: - typename ::emboss::prelude::IntView< + [[nodiscard]] typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<40, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 40>> five_byte() const; - ::emboss::support::Maybe has_five_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_five_byte() const; public: - typename ::emboss::prelude::IntView< + [[nodiscard]] typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<48, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 48>> six_byte() const; - ::emboss::support::Maybe has_six_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_six_byte() const; public: - typename ::emboss::prelude::IntView< + [[nodiscard]] typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<56, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 56>> seven_byte() const; - ::emboss::support::Maybe has_seven_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_seven_byte() const; public: - typename ::emboss::prelude::IntView< + [[nodiscard]] typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<64, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 64>> eight_byte() const; - ::emboss::support::Maybe has_eight_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_eight_byte() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -906,9 +846,9 @@ class GenericSizesView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -917,13 +857,13 @@ class GenericSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -941,9 +881,9 @@ class GenericSizesView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -952,13 +892,13 @@ class GenericSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -976,9 +916,9 @@ class GenericSizesView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -987,13 +927,13 @@ class GenericSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1024,7 +964,7 @@ struct EmbossReservedInternalIsGenericSizesView< }; template -inline GenericSizesView< +[[nodiscard]] inline GenericSizesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1039,7 +979,7 @@ MakeSizesView( T &&emboss_reserved_local_arg) { } template -inline GenericSizesView> +[[nodiscard]] inline GenericSizesView> MakeSizesView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericSizesView>( @@ -1048,7 +988,7 @@ MakeSizesView( T *emboss_reserved_local_data, } template -inline GenericSizesView< +[[nodiscard]] inline GenericSizesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedSizesView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/large_array.emb.h b/testdata/golden_cpp/large_array.emb.h index 81048d8..9985afe 100644 --- a/testdata/golden_cpp/large_array.emb.h +++ b/testdata/golden_cpp/large_array.emb.h @@ -88,64 +88,40 @@ class GenericUIntArrayView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !element_count().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !elements().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!element_count().Ok()) return false; + if (!elements().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericUIntArrayView emboss_reserved_local_other) const { if (!has_element_count().Known()) return false; @@ -183,7 +159,7 @@ class GenericUIntArrayView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericUIntArrayView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_element_count().ValueOr(false) && @@ -230,7 +206,7 @@ class GenericUIntArrayView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericUIntArrayView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -363,18 +339,18 @@ class GenericUIntArrayView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> element_count() const; - ::emboss::support::Maybe has_element_count() const; + [[nodiscard]] ::emboss::support::Maybe has_element_count() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 32>> @@ -383,7 +359,7 @@ class GenericUIntArrayView final { 8 > elements() const; - ::emboss::support::Maybe has_elements() const; + [[nodiscard]] ::emboss::support::Maybe has_elements() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -402,17 +378,17 @@ class GenericUIntArrayView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int64_t Read() const { + [[nodiscard]] ::std::int64_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int64_t UncheckedRead() const { + [[nodiscard]] ::std::int64_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -425,12 +401,12 @@ class GenericUIntArrayView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.element_count(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Product(::emboss::support::Maybe(static_cast(4LL)), emboss_reserved_local_subexpr_2); @@ -441,7 +417,7 @@ class GenericUIntArrayView final { return emboss_reserved_local_subexpr_6; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int64_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -449,8 +425,8 @@ class GenericUIntArrayView final { const GenericUIntArrayView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -466,9 +442,9 @@ class GenericUIntArrayView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int64_t Read(); - static constexpr ::std::int64_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int64_t Read(); + [[nodiscard]] static constexpr ::std::int64_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -477,13 +453,13 @@ class GenericUIntArrayView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -501,9 +477,9 @@ class GenericUIntArrayView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -512,13 +488,13 @@ class GenericUIntArrayView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -549,7 +525,7 @@ struct EmbossReservedInternalIsGenericUIntArrayView< }; template -inline GenericUIntArrayView< +[[nodiscard]] inline GenericUIntArrayView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -564,7 +540,7 @@ MakeUIntArrayView( T &&emboss_reserved_local_arg) { } template -inline GenericUIntArrayView> +[[nodiscard]] inline GenericUIntArrayView> MakeUIntArrayView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericUIntArrayView>( @@ -573,7 +549,7 @@ MakeUIntArrayView( T *emboss_reserved_local_data, } template -inline GenericUIntArrayView< +[[nodiscard]] inline GenericUIntArrayView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedUIntArrayView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/nested_structure.emb.h b/testdata/golden_cpp/nested_structure.emb.h index 9da33ea..2b37ffd 100644 --- a/testdata/golden_cpp/nested_structure.emb.h +++ b/testdata/golden_cpp/nested_structure.emb.h @@ -105,72 +105,42 @@ class GenericContainerView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !weight().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !important_box().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !other_box().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!weight().Ok()) return false; + if (!important_box().Ok()) return false; + if (!other_box().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericContainerView emboss_reserved_local_other) const { if (!has_weight().Known()) return false; @@ -225,7 +195,7 @@ class GenericContainerView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericContainerView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_weight().ValueOr(false) && @@ -286,7 +256,7 @@ class GenericContainerView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericContainerView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -457,27 +427,27 @@ class GenericContainerView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> weight() const; - ::emboss::support::Maybe has_weight() const; + [[nodiscard]] ::emboss::support::Maybe has_weight() const; public: - typename ::emboss::test::GenericBoxView> + [[nodiscard]] typename ::emboss::test::GenericBoxView> important_box() const; - ::emboss::support::Maybe has_important_box() const; + [[nodiscard]] ::emboss::support::Maybe has_important_box() const; public: - typename ::emboss::test::GenericBoxView> + [[nodiscard]] typename ::emboss::test::GenericBoxView> other_box() const; - ::emboss::support::Maybe has_other_box() const; + [[nodiscard]] ::emboss::support::Maybe has_other_box() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -493,9 +463,9 @@ class GenericContainerView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -504,13 +474,13 @@ class GenericContainerView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -528,9 +498,9 @@ class GenericContainerView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -539,13 +509,13 @@ class GenericContainerView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -563,9 +533,9 @@ class GenericContainerView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -574,13 +544,13 @@ class GenericContainerView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -611,7 +581,7 @@ struct EmbossReservedInternalIsGenericContainerView< }; template -inline GenericContainerView< +[[nodiscard]] inline GenericContainerView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -626,7 +596,7 @@ MakeContainerView( T &&emboss_reserved_local_arg) { } template -inline GenericContainerView> +[[nodiscard]] inline GenericContainerView> MakeContainerView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericContainerView>( @@ -635,7 +605,7 @@ MakeContainerView( T *emboss_reserved_local_data, } template -inline GenericContainerView< +[[nodiscard]] inline GenericContainerView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedContainerView( T *emboss_reserved_local_data, @@ -701,65 +671,41 @@ class GenericBoxView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !id().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !count().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!id().Ok()) return false; + if (!count().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericBoxView emboss_reserved_local_other) const { if (!has_id().Known()) return false; @@ -797,7 +743,7 @@ class GenericBoxView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericBoxView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_id().ValueOr(false) && @@ -844,7 +790,7 @@ class GenericBoxView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericBoxView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -977,23 +923,23 @@ class GenericBoxView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> id() const; - ::emboss::support::Maybe has_id() const; + [[nodiscard]] ::emboss::support::Maybe has_id() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> count() const; - ::emboss::support::Maybe has_count() const; + [[nodiscard]] ::emboss::support::Maybe has_count() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -1009,9 +955,9 @@ class GenericBoxView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1020,13 +966,13 @@ class GenericBoxView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1044,9 +990,9 @@ class GenericBoxView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1055,13 +1001,13 @@ class GenericBoxView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1079,9 +1025,9 @@ class GenericBoxView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1090,13 +1036,13 @@ class GenericBoxView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1127,7 +1073,7 @@ struct EmbossReservedInternalIsGenericBoxView< }; template -inline GenericBoxView< +[[nodiscard]] inline GenericBoxView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1142,7 +1088,7 @@ MakeBoxView( T &&emboss_reserved_local_arg) { } template -inline GenericBoxView> +[[nodiscard]] inline GenericBoxView> MakeBoxView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericBoxView>( @@ -1151,7 +1097,7 @@ MakeBoxView( T *emboss_reserved_local_data, } template -inline GenericBoxView< +[[nodiscard]] inline GenericBoxView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedBoxView( T *emboss_reserved_local_data, @@ -1217,65 +1163,41 @@ class GenericTruckView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !id().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !cargo().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!id().Ok()) return false; + if (!cargo().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericTruckView emboss_reserved_local_other) const { if (!has_id().Known()) return false; @@ -1313,7 +1235,7 @@ class GenericTruckView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericTruckView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_id().ValueOr(false) && @@ -1360,7 +1282,7 @@ class GenericTruckView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericTruckView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1493,25 +1415,25 @@ class GenericTruckView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> id() const; - ::emboss::support::Maybe has_id() const; + [[nodiscard]] ::emboss::support::Maybe has_id() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::test::GenericContainerView::template OffsetStorageType> , typename Storage::template OffsetStorageType, 20, 8 > cargo() const; - ::emboss::support::Maybe has_cargo() const; + [[nodiscard]] ::emboss::support::Maybe has_cargo() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -1527,9 +1449,9 @@ class GenericTruckView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1538,13 +1460,13 @@ class GenericTruckView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1562,9 +1484,9 @@ class GenericTruckView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1573,13 +1495,13 @@ class GenericTruckView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1597,9 +1519,9 @@ class GenericTruckView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1608,13 +1530,13 @@ class GenericTruckView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1645,7 +1567,7 @@ struct EmbossReservedInternalIsGenericTruckView< }; template -inline GenericTruckView< +[[nodiscard]] inline GenericTruckView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1660,7 +1582,7 @@ MakeTruckView( T &&emboss_reserved_local_arg) { } template -inline GenericTruckView> +[[nodiscard]] inline GenericTruckView> MakeTruckView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericTruckView>( @@ -1669,7 +1591,7 @@ MakeTruckView( T *emboss_reserved_local_data, } template -inline GenericTruckView< +[[nodiscard]] inline GenericTruckView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedTruckView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/next_keyword.emb.h b/testdata/golden_cpp/next_keyword.emb.h index eb40049..a6988e3 100644 --- a/testdata/golden_cpp/next_keyword.emb.h +++ b/testdata/golden_cpp/next_keyword.emb.h @@ -90,79 +90,43 @@ class GenericNextKeywordView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !value32().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !value16().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !value8().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !value8_offset().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!value32().Ok()) return false; + if (!value16().Ok()) return false; + if (!value8().Ok()) return false; + if (!value8_offset().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericNextKeywordView emboss_reserved_local_other) const { if (!has_value32().Known()) return false; @@ -234,7 +198,7 @@ class GenericNextKeywordView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericNextKeywordView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_value32().ValueOr(false) && @@ -309,7 +273,7 @@ class GenericNextKeywordView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericNextKeywordView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -518,39 +482,39 @@ class GenericNextKeywordView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> value32() const; - ::emboss::support::Maybe has_value32() const; + [[nodiscard]] ::emboss::support::Maybe has_value32() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<16, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 16>> value16() const; - ::emboss::support::Maybe has_value16() const; + [[nodiscard]] ::emboss::support::Maybe has_value16() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> value8() const; - ::emboss::support::Maybe has_value8() const; + [[nodiscard]] ::emboss::support::Maybe has_value8() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> value8_offset() const; - ::emboss::support::Maybe has_value8_offset() const; + [[nodiscard]] ::emboss::support::Maybe has_value8_offset() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -566,9 +530,9 @@ class GenericNextKeywordView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -577,13 +541,13 @@ class GenericNextKeywordView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -601,9 +565,9 @@ class GenericNextKeywordView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -612,13 +576,13 @@ class GenericNextKeywordView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -636,9 +600,9 @@ class GenericNextKeywordView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -647,13 +611,13 @@ class GenericNextKeywordView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -684,7 +648,7 @@ struct EmbossReservedInternalIsGenericNextKeywordView< }; template -inline GenericNextKeywordView< +[[nodiscard]] inline GenericNextKeywordView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -699,7 +663,7 @@ MakeNextKeywordView( T &&emboss_reserved_local_arg) { } template -inline GenericNextKeywordView> +[[nodiscard]] inline GenericNextKeywordView> MakeNextKeywordView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericNextKeywordView>( @@ -708,7 +672,7 @@ MakeNextKeywordView( T *emboss_reserved_local_data, } template -inline GenericNextKeywordView< +[[nodiscard]] inline GenericNextKeywordView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedNextKeywordView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/no_enum_traits.emb.h b/testdata/golden_cpp/no_enum_traits.emb.h index c0aaafa..0c3b29f 100644 --- a/testdata/golden_cpp/no_enum_traits.emb.h +++ b/testdata/golden_cpp/no_enum_traits.emb.h @@ -89,58 +89,40 @@ class GenericBarView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !foo().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!foo().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; - } - - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericBarView emboss_reserved_local_other) const { if (!has_foo().Known()) return false; @@ -161,7 +143,7 @@ class GenericBarView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericBarView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_foo().ValueOr(false) && @@ -194,7 +176,7 @@ class GenericBarView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericBarView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -203,16 +185,16 @@ class GenericBarView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::Foo, ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> foo() const; - ::emboss::support::Maybe has_foo() const; + [[nodiscard]] ::emboss::support::Maybe has_foo() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -228,9 +210,9 @@ class GenericBarView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -239,13 +221,13 @@ class GenericBarView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -263,9 +245,9 @@ class GenericBarView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -274,13 +256,13 @@ class GenericBarView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -298,9 +280,9 @@ class GenericBarView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -309,13 +291,13 @@ class GenericBarView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -346,7 +328,7 @@ struct EmbossReservedInternalIsGenericBarView< }; template -inline GenericBarView< +[[nodiscard]] inline GenericBarView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -361,7 +343,7 @@ MakeBarView( T &&emboss_reserved_local_arg) { } template -inline GenericBarView> +[[nodiscard]] inline GenericBarView> MakeBarView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericBarView>( @@ -370,7 +352,7 @@ MakeBarView( T *emboss_reserved_local_data, } template -inline GenericBarView< +[[nodiscard]] inline GenericBarView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedBarView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/parameters.emb.h b/testdata/golden_cpp/parameters.emb.h index b6c33ae..03e4169 100644 --- a/testdata/golden_cpp/parameters.emb.h +++ b/testdata/golden_cpp/parameters.emb.h @@ -385,79 +385,65 @@ class GenericMultiVersionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; if (!parameters_initialized_) return false; - const auto emboss_reserved_local_ok_subexpr_1 = message_id(); + const auto emboss_reserved_local_ok_subexpr_1 = message_id(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = product(); + const auto emboss_reserved_local_ok_subexpr_4 = (emboss_reserved_local_ok_subexpr_3.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_3.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_5 = ::emboss::support::Equal(emboss_reserved_local_ok_subexpr_4, ::emboss::support::Maybe(static_cast(23))); + const auto emboss_reserved_local_ok_subexpr_6 = ::emboss::support::Equal(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(1))); + const auto emboss_reserved_local_ok_subexpr_7 = ::emboss::support::And(emboss_reserved_local_ok_subexpr_5, emboss_reserved_local_ok_subexpr_6); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !message_id().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !axes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(1))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !config().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::Equal((product().Ok() ? ::emboss::support::Maybe(static_cast(product().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(23))), ::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(1)))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !config_vx().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!message_id().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_switch_discrim = emboss_reserved_local_ok_subexpr_2; + if (!emboss_reserved_switch_discrim.Known()) return false; + switch (emboss_reserved_switch_discrim.ValueOrDefault()) { + case static_cast(0): + if (!axes().Ok()) return false; + break; + case static_cast(1): + if (!config().Ok()) return false; + break; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_7; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!config_vx().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericMultiVersionView emboss_reserved_local_other) const { if (!has_product().Known()) return false; @@ -546,7 +532,7 @@ if (!parameters_initialized_) return false; return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericMultiVersionView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_product().ValueOr(false) && @@ -635,7 +621,7 @@ if (!parameters_initialized_) return false; emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericMultiVersionView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -844,46 +830,46 @@ if (!parameters_initialized_) return false; - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } private: - constexpr ::emboss::support::MaybeConstantView + [[nodiscard]] constexpr ::emboss::support::MaybeConstantView product() const { return parameters_initialized_ ? ::emboss::support::MaybeConstantView( product_) : ::emboss::support::MaybeConstantView(); } - constexpr ::emboss::support::Maybe has_product() const { + [[nodiscard]] constexpr ::emboss::support::Maybe has_product() const { return ::emboss::support::Maybe(parameters_initialized_); } public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::MessageId, ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> message_id() const; - ::emboss::support::Maybe has_message_id() const; + [[nodiscard]] ::emboss::support::Maybe has_message_id() const; public: - typename ::emboss::test::GenericAxesView> + [[nodiscard]] typename ::emboss::test::GenericAxesView> axes() const; - ::emboss::support::Maybe has_axes() const; + [[nodiscard]] ::emboss::support::Maybe has_axes() const; public: - typename ::emboss::test::GenericConfigView>, 32>> + [[nodiscard]] typename ::emboss::test::GenericConfigView>, 32>> config() const; - ::emboss::support::Maybe has_config() const; + [[nodiscard]] ::emboss::support::Maybe has_config() const; public: - typename ::emboss::test::GenericConfigVXView> + [[nodiscard]] typename ::emboss::test::GenericConfigVXView> config_vx() const; - ::emboss::support::Maybe has_config_vx() const; + [[nodiscard]] ::emboss::support::Maybe has_config_vx() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -902,17 +888,17 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -925,12 +911,12 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.message_id(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(0))); @@ -947,7 +933,7 @@ if (!parameters_initialized_) return false; return emboss_reserved_local_subexpr_12; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -955,8 +941,8 @@ if (!parameters_initialized_) return false; const GenericMultiVersionView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -972,9 +958,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -983,13 +969,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1007,9 +993,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1018,13 +1004,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1055,7 +1041,7 @@ struct EmbossReservedInternalIsGenericMultiVersionView< }; template -inline GenericMultiVersionView< +[[nodiscard]] inline GenericMultiVersionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1070,7 +1056,7 @@ MakeMultiVersionView(::emboss::test::Product product, T &&emboss_reserved_local } template -inline GenericMultiVersionView> +[[nodiscard]] inline GenericMultiVersionView> MakeMultiVersionView(::emboss::test::Product product, T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericMultiVersionView>( @@ -1079,7 +1065,7 @@ MakeMultiVersionView(::emboss::test::Product product, T *emboss_reserved_local_ } template -inline GenericMultiVersionView< +[[nodiscard]] inline GenericMultiVersionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedMultiVersionView( ::emboss::test::Product product, T *emboss_reserved_local_data, @@ -1149,86 +1135,66 @@ class GenericAxesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; if (!parameters_initialized_) return false; - const auto emboss_reserved_local_ok_subexpr_1 = axes(); - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !values().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThan((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThan((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(1LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; - } - + const auto emboss_reserved_local_ok_subexpr_1 = axes(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::GreaterThan(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(0LL))); + const auto emboss_reserved_local_ok_subexpr_4 = ::emboss::support::GreaterThan(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(1LL))); + const auto emboss_reserved_local_ok_subexpr_5 = ::emboss::support::GreaterThan(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(2LL))); { - const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThan((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(2LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !z().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !axis_count_plus_one().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!values().Ok()) return false; + if (!axis_count_plus_one().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_3; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_4; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!y().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_5; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!z().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericAxesView emboss_reserved_local_other) const { if (!has_axes().Known()) return false; @@ -1317,7 +1283,7 @@ if (!parameters_initialized_) return false; return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericAxesView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_axes().ValueOr(false) && @@ -1406,7 +1372,7 @@ if (!parameters_initialized_) return false; emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericAxesView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1634,47 +1600,47 @@ if (!parameters_initialized_) return false; - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } private: - constexpr ::emboss::support::MaybeConstantView + [[nodiscard]] constexpr ::emboss::support::MaybeConstantView axes() const { return parameters_initialized_ ? ::emboss::support::MaybeConstantView( axes_) : ::emboss::support::MaybeConstantView(); } - constexpr ::emboss::support::Maybe has_axes() const { + [[nodiscard]] constexpr ::emboss::support::Maybe has_axes() const { return ::emboss::support::Maybe(parameters_initialized_); } public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::test::GenericAxisView::template OffsetStorageType> , typename Storage::template OffsetStorageType, 4, 8 , ::emboss::test::AxisType> values() const; - ::emboss::support::Maybe has_values() const; + [[nodiscard]] ::emboss::support::Maybe has_values() const; public: - typename ::emboss::test::GenericAxisView> + [[nodiscard]] typename ::emboss::test::GenericAxisView> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::test::GenericAxisView> + [[nodiscard]] typename ::emboss::test::GenericAxisView> y() const; - ::emboss::support::Maybe has_y() const; + [[nodiscard]] ::emboss::support::Maybe has_y() const; public: - typename ::emboss::test::GenericAxisView> + [[nodiscard]] typename ::emboss::test::GenericAxisView> z() const; - ::emboss::support::Maybe has_z() const; + [[nodiscard]] ::emboss::support::Maybe has_z() const; public: class EmbossReservedVirtualAxisCountPlusOneView final { @@ -1693,17 +1659,17 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedVirtualAxisCountPlusOneView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_axis_count_plus_one().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -1716,12 +1682,12 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.axes(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(1LL))); @@ -1729,7 +1695,7 @@ if (!parameters_initialized_) return false; return emboss_reserved_local_subexpr_3; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -1737,8 +1703,8 @@ if (!parameters_initialized_) return false; const GenericAxesView view_; }; - EmbossReservedVirtualAxisCountPlusOneView axis_count_plus_one() const; - ::emboss::support::Maybe has_axis_count_plus_one() const; + [[nodiscard]] EmbossReservedVirtualAxisCountPlusOneView axis_count_plus_one() const; + [[nodiscard]] ::emboss::support::Maybe has_axis_count_plus_one() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -1757,17 +1723,17 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -1780,12 +1746,12 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.axes(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Product(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(4LL))); @@ -1802,7 +1768,7 @@ if (!parameters_initialized_) return false; return emboss_reserved_local_subexpr_12; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -1810,8 +1776,8 @@ if (!parameters_initialized_) return false; const GenericAxesView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -1827,9 +1793,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1838,13 +1804,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1862,9 +1828,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1873,13 +1839,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1910,7 +1876,7 @@ struct EmbossReservedInternalIsGenericAxesView< }; template -inline GenericAxesView< +[[nodiscard]] inline GenericAxesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1925,7 +1891,7 @@ MakeAxesView(::std::int32_t axes, T &&emboss_reserved_local_arg) { } template -inline GenericAxesView> +[[nodiscard]] inline GenericAxesView> MakeAxesView(::std::int32_t axes, T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericAxesView>( @@ -1934,7 +1900,7 @@ MakeAxesView(::std::int32_t axes, T *emboss_reserved_local_data, } template -inline GenericAxesView< +[[nodiscard]] inline GenericAxesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedAxesView( ::std::int32_t axes, T *emboss_reserved_local_data, @@ -2007,79 +1973,43 @@ class GenericAxisPairView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; if (!parameters_initialized_) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !axis_type_a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !axis_a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !axis_type_b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !axis_b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!axis_type_a().Ok()) return false; + if (!axis_a().Ok()) return false; + if (!axis_type_b().Ok()) return false; + if (!axis_b().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericAxisPairView emboss_reserved_local_other) const { if (!has_axis_type_a_parameter().Known()) return false; @@ -2151,7 +2081,7 @@ if (!parameters_initialized_) return false; return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericAxisPairView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_axis_type_a_parameter().ValueOr(false) && @@ -2226,7 +2156,7 @@ if (!parameters_initialized_) return false; emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericAxisPairView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -2397,29 +2327,29 @@ if (!parameters_initialized_) return false; - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } private: - constexpr ::emboss::support::MaybeConstantView + [[nodiscard]] constexpr ::emboss::support::MaybeConstantView axis_type_a_parameter() const { return parameters_initialized_ ? ::emboss::support::MaybeConstantView( axis_type_a_parameter_) : ::emboss::support::MaybeConstantView(); } - constexpr ::emboss::support::Maybe has_axis_type_a_parameter() const { + [[nodiscard]] constexpr ::emboss::support::Maybe has_axis_type_a_parameter() const { return ::emboss::support::Maybe(parameters_initialized_); } private: - constexpr ::emboss::support::MaybeConstantView + [[nodiscard]] constexpr ::emboss::support::MaybeConstantView axis_type_b_parameter() const { return parameters_initialized_ ? ::emboss::support::MaybeConstantView( axis_type_b_parameter_) : ::emboss::support::MaybeConstantView(); } - constexpr ::emboss::support::Maybe has_axis_type_b_parameter() const { + [[nodiscard]] constexpr ::emboss::support::Maybe has_axis_type_b_parameter() const { return ::emboss::support::Maybe(parameters_initialized_); } @@ -2440,17 +2370,17 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedVirtualAxisTypeAView() = default; - ::emboss::test::AxisType Read() const { + [[nodiscard]] ::emboss::test::AxisType Read() const { EMBOSS_CHECK(view_.has_axis_type_a().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::emboss::test::AxisType UncheckedRead() const { + [[nodiscard]] ::emboss::test::AxisType UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -2463,19 +2393,19 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.axis_type_a_parameter(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); return emboss_reserved_local_subexpr_2; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::emboss::test::AxisType emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -2483,14 +2413,14 @@ if (!parameters_initialized_) return false; const GenericAxisPairView view_; }; - EmbossReservedVirtualAxisTypeAView axis_type_a() const; - ::emboss::support::Maybe has_axis_type_a() const; + [[nodiscard]] EmbossReservedVirtualAxisTypeAView axis_type_a() const; + [[nodiscard]] ::emboss::support::Maybe has_axis_type_a() const; public: - typename ::emboss::test::GenericAxisView> + [[nodiscard]] typename ::emboss::test::GenericAxisView> axis_a() const; - ::emboss::support::Maybe has_axis_a() const; + [[nodiscard]] ::emboss::support::Maybe has_axis_a() const; public: class EmbossReservedVirtualAxisTypeBView final { @@ -2509,17 +2439,17 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedVirtualAxisTypeBView() = default; - ::emboss::test::AxisType Read() const { + [[nodiscard]] ::emboss::test::AxisType Read() const { EMBOSS_CHECK(view_.has_axis_type_b().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::emboss::test::AxisType UncheckedRead() const { + [[nodiscard]] ::emboss::test::AxisType UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -2532,19 +2462,19 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.axis_type_b_parameter(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); return emboss_reserved_local_subexpr_2; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::emboss::test::AxisType emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -2552,14 +2482,14 @@ if (!parameters_initialized_) return false; const GenericAxisPairView view_; }; - EmbossReservedVirtualAxisTypeBView axis_type_b() const; - ::emboss::support::Maybe has_axis_type_b() const; + [[nodiscard]] EmbossReservedVirtualAxisTypeBView axis_type_b() const; + [[nodiscard]] ::emboss::support::Maybe has_axis_type_b() const; public: - typename ::emboss::test::GenericAxisView> + [[nodiscard]] typename ::emboss::test::GenericAxisView> axis_b() const; - ::emboss::support::Maybe has_axis_b() const; + [[nodiscard]] ::emboss::support::Maybe has_axis_b() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -2575,9 +2505,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2586,13 +2516,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2610,9 +2540,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2621,13 +2551,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2645,9 +2575,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2656,13 +2586,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2694,7 +2624,7 @@ struct EmbossReservedInternalIsGenericAxisPairView< }; template -inline GenericAxisPairView< +[[nodiscard]] inline GenericAxisPairView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2709,7 +2639,7 @@ MakeAxisPairView(::emboss::test::AxisType axis_type_a_parameter, ::emboss::test: } template -inline GenericAxisPairView> +[[nodiscard]] inline GenericAxisPairView> MakeAxisPairView(::emboss::test::AxisType axis_type_a_parameter, ::emboss::test::AxisType axis_type_b_parameter, T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericAxisPairView>( @@ -2718,7 +2648,7 @@ MakeAxisPairView(::emboss::test::AxisType axis_type_a_parameter, ::emboss::test: } template -inline GenericAxisPairView< +[[nodiscard]] inline GenericAxisPairView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedAxisPairView( ::emboss::test::AxisType axis_type_a_parameter, ::emboss::test::AxisType axis_type_b_parameter, T *emboss_reserved_local_data, @@ -2784,64 +2714,40 @@ class GenericAxesEnvelopeView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !axis_count().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !axes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!axis_count().Ok()) return false; + if (!axes().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericAxesEnvelopeView emboss_reserved_local_other) const { if (!has_axis_count().Known()) return false; @@ -2879,7 +2785,7 @@ class GenericAxesEnvelopeView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericAxesEnvelopeView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_axis_count().ValueOr(false) && @@ -2926,7 +2832,7 @@ class GenericAxesEnvelopeView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericAxesEnvelopeView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -3059,21 +2965,21 @@ class GenericAxesEnvelopeView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> axis_count() const; - ::emboss::support::Maybe has_axis_count() const; + [[nodiscard]] ::emboss::support::Maybe has_axis_count() const; public: - typename ::emboss::test::GenericAxesView> + [[nodiscard]] typename ::emboss::test::GenericAxesView> axes() const; - ::emboss::support::Maybe has_axes() const; + [[nodiscard]] ::emboss::support::Maybe has_axes() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -3092,17 +2998,17 @@ class GenericAxesEnvelopeView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -3115,12 +3021,12 @@ class GenericAxesEnvelopeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.axis_count(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Product(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(4LL))); @@ -3131,7 +3037,7 @@ class GenericAxesEnvelopeView final { return emboss_reserved_local_subexpr_6; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -3139,8 +3045,8 @@ class GenericAxesEnvelopeView final { const GenericAxesEnvelopeView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -3156,9 +3062,9 @@ class GenericAxesEnvelopeView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3167,13 +3073,13 @@ class GenericAxesEnvelopeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3191,9 +3097,9 @@ class GenericAxesEnvelopeView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3202,13 +3108,13 @@ class GenericAxesEnvelopeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3239,7 +3145,7 @@ struct EmbossReservedInternalIsGenericAxesEnvelopeView< }; template -inline GenericAxesEnvelopeView< +[[nodiscard]] inline GenericAxesEnvelopeView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3254,7 +3160,7 @@ MakeAxesEnvelopeView( T &&emboss_reserved_local_arg) { } template -inline GenericAxesEnvelopeView> +[[nodiscard]] inline GenericAxesEnvelopeView> MakeAxesEnvelopeView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericAxesEnvelopeView>( @@ -3263,7 +3169,7 @@ MakeAxesEnvelopeView( T *emboss_reserved_local_data, } template -inline GenericAxesEnvelopeView< +[[nodiscard]] inline GenericAxesEnvelopeView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedAxesEnvelopeView( T *emboss_reserved_local_data, @@ -3440,87 +3346,58 @@ class GenericAxisView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; if (!parameters_initialized_) return false; - const auto emboss_reserved_local_ok_subexpr_1 = axis_type(); - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !value().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !axis_type().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(1))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - + const auto emboss_reserved_local_ok_subexpr_1 = axis_type(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(2))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal((emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(3))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !z().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!value().Ok()) return false; + if (!axis_type().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_switch_discrim = emboss_reserved_local_ok_subexpr_2; + if (!emboss_reserved_switch_discrim.Known()) return false; + switch (emboss_reserved_switch_discrim.ValueOrDefault()) { + case static_cast(1): + if (!x().Ok()) return false; + break; + case static_cast(2): + if (!y().Ok()) return false; + break; + case static_cast(3): + if (!z().Ok()) return false; + break; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericAxisView emboss_reserved_local_other) const { if (!has_axis_type_parameter().Known()) return false; @@ -3609,7 +3486,7 @@ if (!parameters_initialized_) return false; return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericAxisView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_axis_type_parameter().ValueOr(false) && @@ -3698,7 +3575,7 @@ if (!parameters_initialized_) return false; emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericAxisView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -3926,27 +3803,27 @@ if (!parameters_initialized_) return false; - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } private: - constexpr ::emboss::support::MaybeConstantView + [[nodiscard]] constexpr ::emboss::support::MaybeConstantView axis_type_parameter() const { return parameters_initialized_ ? ::emboss::support::MaybeConstantView( axis_type_parameter_) : ::emboss::support::MaybeConstantView(); } - constexpr ::emboss::support::Maybe has_axis_type_parameter() const { + [[nodiscard]] constexpr ::emboss::support::Maybe has_axis_type_parameter() const { return ::emboss::support::Maybe(parameters_initialized_); } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> value() const; - ::emboss::support::Maybe has_value() const; + [[nodiscard]] ::emboss::support::Maybe has_value() const; public: class EmbossReservedVirtualAxisTypeView final { @@ -3965,17 +3842,17 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedVirtualAxisTypeView() = default; - ::emboss::test::AxisType Read() const { + [[nodiscard]] ::emboss::test::AxisType Read() const { EMBOSS_CHECK(view_.has_axis_type().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::emboss::test::AxisType UncheckedRead() const { + [[nodiscard]] ::emboss::test::AxisType UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -3988,19 +3865,19 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.axis_type_parameter(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); return emboss_reserved_local_subexpr_2; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::emboss::test::AxisType emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -4008,32 +3885,32 @@ if (!parameters_initialized_) return false; const GenericAxisView view_; }; - EmbossReservedVirtualAxisTypeView axis_type() const; - ::emboss::support::Maybe has_axis_type() const; + [[nodiscard]] EmbossReservedVirtualAxisTypeView axis_type() const; + [[nodiscard]] ::emboss::support::Maybe has_axis_type() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> y() const; - ::emboss::support::Maybe has_y() const; + [[nodiscard]] ::emboss::support::Maybe has_y() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> z() const; - ::emboss::support::Maybe has_z() const; + [[nodiscard]] ::emboss::support::Maybe has_z() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -4049,9 +3926,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4060,13 +3937,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4084,9 +3961,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4095,13 +3972,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4119,9 +3996,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4130,13 +4007,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4167,7 +4044,7 @@ struct EmbossReservedInternalIsGenericAxisView< }; template -inline GenericAxisView< +[[nodiscard]] inline GenericAxisView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4182,7 +4059,7 @@ MakeAxisView(::emboss::test::AxisType axis_type_parameter, T &&emboss_reserved_ } template -inline GenericAxisView> +[[nodiscard]] inline GenericAxisView> MakeAxisView(::emboss::test::AxisType axis_type_parameter, T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericAxisView>( @@ -4191,7 +4068,7 @@ MakeAxisView(::emboss::test::AxisType axis_type_parameter, T *emboss_reserved_l } template -inline GenericAxisView< +[[nodiscard]] inline GenericAxisView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedAxisView( ::emboss::test::AxisType axis_type_parameter, T *emboss_reserved_local_data, @@ -4256,58 +4133,40 @@ class GenericConfigView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !power().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!power().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericConfigView emboss_reserved_local_other) const { if (!has_power().Known()) return false; @@ -4328,7 +4187,7 @@ class GenericConfigView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericConfigView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_power().ValueOr(false) && @@ -4361,7 +4220,7 @@ class GenericConfigView final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericConfigView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -4456,15 +4315,15 @@ class GenericConfigView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> power() const; - ::emboss::support::Maybe has_power() const; + [[nodiscard]] ::emboss::support::Maybe has_power() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -4480,9 +4339,9 @@ class GenericConfigView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4491,13 +4350,13 @@ class GenericConfigView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -4515,9 +4374,9 @@ class GenericConfigView final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4526,13 +4385,13 @@ class GenericConfigView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -4550,9 +4409,9 @@ class GenericConfigView final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4561,13 +4420,13 @@ class GenericConfigView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -4598,7 +4457,7 @@ struct EmbossReservedInternalIsGenericConfigView< }; template -inline GenericConfigView< +[[nodiscard]] inline GenericConfigView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4613,7 +4472,7 @@ MakeConfigView( T &&emboss_reserved_local_arg) { } template -inline GenericConfigView> +[[nodiscard]] inline GenericConfigView> MakeConfigView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericConfigView>( @@ -4622,7 +4481,7 @@ MakeConfigView( T *emboss_reserved_local_data, } template -inline GenericConfigView< +[[nodiscard]] inline GenericConfigView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConfigView( T *emboss_reserved_local_data, @@ -4693,58 +4552,40 @@ class GenericEmbossReservedAnonymousField1View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !power().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!power().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { if (!has_power().Known()) return false; @@ -4765,7 +4606,7 @@ class GenericEmbossReservedAnonymousField1View final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_power().ValueOr(false) && @@ -4798,7 +4639,7 @@ class GenericEmbossReservedAnonymousField1View final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -4893,15 +4734,15 @@ class GenericEmbossReservedAnonymousField1View final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> power() const; - ::emboss::support::Maybe has_power() const; + [[nodiscard]] ::emboss::support::Maybe has_power() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -4917,9 +4758,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4928,13 +4769,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -4952,9 +4793,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4963,13 +4804,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -4987,9 +4828,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4998,13 +4839,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -5035,7 +4876,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField1View< }; template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5050,7 +4891,7 @@ MakeEmbossReservedAnonymousField1View( T &&emboss_reserved_local_arg) { } template -inline GenericEmbossReservedAnonymousField1View> +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View> MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericEmbossReservedAnonymousField1View>( @@ -5059,7 +4900,7 @@ MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, @@ -5120,72 +4961,49 @@ class GenericConfigVXView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !power().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !gain().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!emboss_reserved_anonymous_field_1().Ok()) return false; + if (!gain().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!power().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericConfigVXView emboss_reserved_local_other) const { if (!has_emboss_reserved_anonymous_field_1().Known()) return false; @@ -5223,7 +5041,7 @@ class GenericConfigVXView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericConfigVXView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_emboss_reserved_anonymous_field_1().ValueOr(false) && @@ -5270,7 +5088,7 @@ class GenericConfigVXView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericConfigVXView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -5403,28 +5221,28 @@ class GenericConfigVXView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } private: - typename ::emboss::test::ConfigVX::GenericEmbossReservedAnonymousField1View>, 32>> + [[nodiscard]] typename ::emboss::test::ConfigVX::GenericEmbossReservedAnonymousField1View>, 32>> emboss_reserved_anonymous_field_1() const; - ::emboss::support::Maybe has_emboss_reserved_anonymous_field_1() const; + [[nodiscard]] ::emboss::support::Maybe has_emboss_reserved_anonymous_field_1() const; public: - auto power() const -> decltype(this->emboss_reserved_anonymous_field_1().power()) { + [[nodiscard]] auto power() const -> decltype(this->emboss_reserved_anonymous_field_1().power()) { return has_power().ValueOrDefault() ? emboss_reserved_anonymous_field_1().power() : decltype(this->emboss_reserved_anonymous_field_1().power())(); } - ::emboss::support::Maybe has_power() const; + [[nodiscard]] ::emboss::support::Maybe has_power() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> gain() const; - ::emboss::support::Maybe has_gain() const; + [[nodiscard]] ::emboss::support::Maybe has_gain() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -5440,9 +5258,9 @@ class GenericConfigVXView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5451,13 +5269,13 @@ class GenericConfigVXView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5475,9 +5293,9 @@ class GenericConfigVXView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5486,13 +5304,13 @@ class GenericConfigVXView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5510,9 +5328,9 @@ class GenericConfigVXView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5521,13 +5339,13 @@ class GenericConfigVXView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5558,7 +5376,7 @@ struct EmbossReservedInternalIsGenericConfigVXView< }; template -inline GenericConfigVXView< +[[nodiscard]] inline GenericConfigVXView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5573,7 +5391,7 @@ MakeConfigVXView( T &&emboss_reserved_local_arg) { } template -inline GenericConfigVXView> +[[nodiscard]] inline GenericConfigVXView> MakeConfigVXView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericConfigVXView>( @@ -5582,7 +5400,7 @@ MakeConfigVXView( T *emboss_reserved_local_data, } template -inline GenericConfigVXView< +[[nodiscard]] inline GenericConfigVXView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConfigVXView( T *emboss_reserved_local_data, @@ -5648,58 +5466,40 @@ class GenericStructWithUnusedParameterView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; if (!parameters_initialized_) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!y().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericStructWithUnusedParameterView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -5737,7 +5537,7 @@ if (!parameters_initialized_) return false; return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericStructWithUnusedParameterView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -5784,7 +5584,7 @@ if (!parameters_initialized_) return false; emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericStructWithUnusedParameterView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -5879,27 +5679,27 @@ if (!parameters_initialized_) return false; - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } private: - constexpr ::emboss::support::MaybeConstantView + [[nodiscard]] constexpr ::emboss::support::MaybeConstantView x() const { return parameters_initialized_ ? ::emboss::support::MaybeConstantView( x_) : ::emboss::support::MaybeConstantView(); } - constexpr ::emboss::support::Maybe has_x() const { + [[nodiscard]] constexpr ::emboss::support::Maybe has_x() const { return ::emboss::support::Maybe(parameters_initialized_); } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> y() const; - ::emboss::support::Maybe has_y() const; + [[nodiscard]] ::emboss::support::Maybe has_y() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -5915,9 +5715,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5926,13 +5726,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5950,9 +5750,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5961,13 +5761,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5985,9 +5785,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5996,13 +5796,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -6033,7 +5833,7 @@ struct EmbossReservedInternalIsGenericStructWithUnusedParameterView< }; template -inline GenericStructWithUnusedParameterView< +[[nodiscard]] inline GenericStructWithUnusedParameterView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -6048,7 +5848,7 @@ MakeStructWithUnusedParameterView(::std::int32_t x, T &&emboss_reserved_local_a } template -inline GenericStructWithUnusedParameterView> +[[nodiscard]] inline GenericStructWithUnusedParameterView> MakeStructWithUnusedParameterView(::std::int32_t x, T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericStructWithUnusedParameterView>( @@ -6057,7 +5857,7 @@ MakeStructWithUnusedParameterView(::std::int32_t x, T *emboss_reserved_local_da } template -inline GenericStructWithUnusedParameterView< +[[nodiscard]] inline GenericStructWithUnusedParameterView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructWithUnusedParameterView( ::std::int32_t x, T *emboss_reserved_local_data, @@ -6123,65 +5923,41 @@ class GenericStructContainingStructWithUnusedParameterView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !swup().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!swup().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericStructContainingStructWithUnusedParameterView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -6219,7 +5995,7 @@ class GenericStructContainingStructWithUnusedParameterView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericStructContainingStructWithUnusedParameterView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -6266,7 +6042,7 @@ class GenericStructContainingStructWithUnusedParameterView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericStructContainingStructWithUnusedParameterView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -6399,21 +6175,21 @@ class GenericStructContainingStructWithUnusedParameterView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::test::GenericStructWithUnusedParameterView> + [[nodiscard]] typename ::emboss::test::GenericStructWithUnusedParameterView> swup() const; - ::emboss::support::Maybe has_swup() const; + [[nodiscard]] ::emboss::support::Maybe has_swup() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -6429,9 +6205,9 @@ class GenericStructContainingStructWithUnusedParameterView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6440,13 +6216,13 @@ class GenericStructContainingStructWithUnusedParameterView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -6464,9 +6240,9 @@ class GenericStructContainingStructWithUnusedParameterView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6475,13 +6251,13 @@ class GenericStructContainingStructWithUnusedParameterView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -6499,9 +6275,9 @@ class GenericStructContainingStructWithUnusedParameterView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6510,13 +6286,13 @@ class GenericStructContainingStructWithUnusedParameterView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -6547,7 +6323,7 @@ struct EmbossReservedInternalIsGenericStructContainingStructWithUnusedParameterV }; template -inline GenericStructContainingStructWithUnusedParameterView< +[[nodiscard]] inline GenericStructContainingStructWithUnusedParameterView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -6562,7 +6338,7 @@ MakeStructContainingStructWithUnusedParameterView( T &&emboss_reserved_local_arg } template -inline GenericStructContainingStructWithUnusedParameterView> +[[nodiscard]] inline GenericStructContainingStructWithUnusedParameterView> MakeStructContainingStructWithUnusedParameterView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericStructContainingStructWithUnusedParameterView>( @@ -6571,7 +6347,7 @@ MakeStructContainingStructWithUnusedParameterView( T *emboss_reserved_local_data } template -inline GenericStructContainingStructWithUnusedParameterView< +[[nodiscard]] inline GenericStructContainingStructWithUnusedParameterView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructContainingStructWithUnusedParameterView( T *emboss_reserved_local_data, @@ -6638,65 +6414,41 @@ class GenericBiasedValueView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; if (!parameters_initialized_) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !raw_value().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !value().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!raw_value().Ok()) return false; + if (!value().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericBiasedValueView emboss_reserved_local_other) const { if (!has_bias().Known()) return false; @@ -6734,7 +6486,7 @@ if (!parameters_initialized_) return false; return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericBiasedValueView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_bias().ValueOr(false) && @@ -6781,7 +6533,7 @@ if (!parameters_initialized_) return false; emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericBiasedValueView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -6895,27 +6647,27 @@ if (!parameters_initialized_) return false; - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } private: - constexpr ::emboss::support::MaybeConstantView + [[nodiscard]] constexpr ::emboss::support::MaybeConstantView bias() const { return parameters_initialized_ ? ::emboss::support::MaybeConstantView( bias_) : ::emboss::support::MaybeConstantView(); } - constexpr ::emboss::support::Maybe has_bias() const { + [[nodiscard]] constexpr ::emboss::support::Maybe has_bias() const { return ::emboss::support::Maybe(parameters_initialized_); } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> raw_value() const; - ::emboss::support::Maybe has_raw_value() const; + [[nodiscard]] ::emboss::support::Maybe has_raw_value() const; public: class EmbossReservedVirtualValueView final { @@ -6934,17 +6686,17 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedVirtualValueView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_value().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -6957,12 +6709,12 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.raw_value(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = view_.bias(); @@ -6972,7 +6724,7 @@ if (!parameters_initialized_) return false; return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -6980,8 +6732,8 @@ if (!parameters_initialized_) return false; const GenericBiasedValueView view_; }; - EmbossReservedVirtualValueView value() const; - ::emboss::support::Maybe has_value() const; + [[nodiscard]] EmbossReservedVirtualValueView value() const; + [[nodiscard]] ::emboss::support::Maybe has_value() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -6997,9 +6749,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -7008,13 +6760,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -7032,9 +6784,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -7043,13 +6795,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -7067,9 +6819,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -7078,13 +6830,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -7115,7 +6867,7 @@ struct EmbossReservedInternalIsGenericBiasedValueView< }; template -inline GenericBiasedValueView< +[[nodiscard]] inline GenericBiasedValueView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -7130,7 +6882,7 @@ MakeBiasedValueView(::std::int32_t bias, T &&emboss_reserved_local_arg) { } template -inline GenericBiasedValueView> +[[nodiscard]] inline GenericBiasedValueView> MakeBiasedValueView(::std::int32_t bias, T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericBiasedValueView>( @@ -7139,7 +6891,7 @@ MakeBiasedValueView(::std::int32_t bias, T *emboss_reserved_local_data, } template -inline GenericBiasedValueView< +[[nodiscard]] inline GenericBiasedValueView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedBiasedValueView( ::std::int32_t bias, T *emboss_reserved_local_data, @@ -7206,65 +6958,41 @@ class GenericVirtualFirstFieldWithParamView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; if (!parameters_initialized_) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !value().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!value().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericVirtualFirstFieldWithParamView emboss_reserved_local_other) const { if (!has_param().Known()) return false; @@ -7302,7 +7030,7 @@ if (!parameters_initialized_) return false; return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericVirtualFirstFieldWithParamView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_param().ValueOr(false) && @@ -7349,7 +7077,7 @@ if (!parameters_initialized_) return false; emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericVirtualFirstFieldWithParamView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -7482,34 +7210,34 @@ if (!parameters_initialized_) return false; - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } private: - constexpr ::emboss::support::MaybeConstantView + [[nodiscard]] constexpr ::emboss::support::MaybeConstantView param() const { return parameters_initialized_ ? ::emboss::support::MaybeConstantView( param_) : ::emboss::support::MaybeConstantView(); } - constexpr ::emboss::support::Maybe has_param() const { + [[nodiscard]] constexpr ::emboss::support::Maybe has_param() const { return ::emboss::support::Maybe(parameters_initialized_); } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - auto value() const -> decltype(this->x()) { + [[nodiscard]] auto value() const -> decltype(this->x()) { return has_value().ValueOrDefault() ? x() : decltype(this->x())(); } - ::emboss::support::Maybe has_value() const; + [[nodiscard]] ::emboss::support::Maybe has_value() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -7525,9 +7253,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -7536,13 +7264,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -7560,9 +7288,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -7571,13 +7299,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -7595,9 +7323,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -7606,13 +7334,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -7643,7 +7371,7 @@ struct EmbossReservedInternalIsGenericVirtualFirstFieldWithParamView< }; template -inline GenericVirtualFirstFieldWithParamView< +[[nodiscard]] inline GenericVirtualFirstFieldWithParamView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -7658,7 +7386,7 @@ MakeVirtualFirstFieldWithParamView(::std::int32_t param, T &&emboss_reserved_lo } template -inline GenericVirtualFirstFieldWithParamView> +[[nodiscard]] inline GenericVirtualFirstFieldWithParamView> MakeVirtualFirstFieldWithParamView(::std::int32_t param, T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericVirtualFirstFieldWithParamView>( @@ -7667,7 +7395,7 @@ MakeVirtualFirstFieldWithParamView(::std::int32_t param, T *emboss_reserved_loc } template -inline GenericVirtualFirstFieldWithParamView< +[[nodiscard]] inline GenericVirtualFirstFieldWithParamView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedVirtualFirstFieldWithParamView( ::std::int32_t param, T *emboss_reserved_local_data, @@ -7734,65 +7462,41 @@ class GenericConstVirtualFirstFieldWithParamView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; if (!parameters_initialized_) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !value().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!value().Ok()) return false; + if (!x().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericConstVirtualFirstFieldWithParamView emboss_reserved_local_other) const { if (!has_param().Known()) return false; @@ -7830,7 +7534,7 @@ if (!parameters_initialized_) return false; return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericConstVirtualFirstFieldWithParamView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_param().ValueOr(false) && @@ -7877,7 +7581,7 @@ if (!parameters_initialized_) return false; emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericConstVirtualFirstFieldWithParamView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -7991,17 +7695,17 @@ if (!parameters_initialized_) return false; - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } private: - constexpr ::emboss::support::MaybeConstantView + [[nodiscard]] constexpr ::emboss::support::MaybeConstantView param() const { return parameters_initialized_ ? ::emboss::support::MaybeConstantView( param_) : ::emboss::support::MaybeConstantView(); } - constexpr ::emboss::support::Maybe has_param() const { + [[nodiscard]] constexpr ::emboss::support::Maybe has_param() const { return ::emboss::support::Maybe(parameters_initialized_); } @@ -8019,9 +7723,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedVirtualValueView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -8030,23 +7734,23 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedVirtualValueView value() { + [[nodiscard]] static constexpr EmbossReservedVirtualValueView value() { return EmbossReservedVirtualValueView(); } - static constexpr ::emboss::support::Maybe has_value() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_value() { return ::emboss::support::Maybe(true); } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -8062,9 +7766,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -8073,13 +7777,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -8097,9 +7801,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -8108,13 +7812,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -8132,9 +7836,9 @@ if (!parameters_initialized_) return false; default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -8143,13 +7847,13 @@ if (!parameters_initialized_) return false; this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -8180,7 +7884,7 @@ struct EmbossReservedInternalIsGenericConstVirtualFirstFieldWithParamView< }; template -inline GenericConstVirtualFirstFieldWithParamView< +[[nodiscard]] inline GenericConstVirtualFirstFieldWithParamView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -8195,7 +7899,7 @@ MakeConstVirtualFirstFieldWithParamView(::std::int32_t param, T &&emboss_reserv } template -inline GenericConstVirtualFirstFieldWithParamView> +[[nodiscard]] inline GenericConstVirtualFirstFieldWithParamView> MakeConstVirtualFirstFieldWithParamView(::std::int32_t param, T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericConstVirtualFirstFieldWithParamView>( @@ -8204,7 +7908,7 @@ MakeConstVirtualFirstFieldWithParamView(::std::int32_t param, T *emboss_reserve } template -inline GenericConstVirtualFirstFieldWithParamView< +[[nodiscard]] inline GenericConstVirtualFirstFieldWithParamView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConstVirtualFirstFieldWithParamView( ::std::int32_t param, T *emboss_reserved_local_data, @@ -8271,71 +7975,41 @@ class GenericSizedArrayOfBiasedValuesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !element_count().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !bias().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !values().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!element_count().Ok()) return false; + if (!bias().Ok()) return false; + if (!values().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericSizedArrayOfBiasedValuesView emboss_reserved_local_other) const { if (!has_element_count().Known()) return false; @@ -8390,7 +8064,7 @@ class GenericSizedArrayOfBiasedValuesView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericSizedArrayOfBiasedValuesView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_element_count().ValueOr(false) && @@ -8451,7 +8125,7 @@ class GenericSizedArrayOfBiasedValuesView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericSizedArrayOfBiasedValuesView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -8622,33 +8296,33 @@ class GenericSizedArrayOfBiasedValuesView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> element_count() const; - ::emboss::support::Maybe has_element_count() const; + [[nodiscard]] ::emboss::support::Maybe has_element_count() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> bias() const; - ::emboss::support::Maybe has_bias() const; + [[nodiscard]] ::emboss::support::Maybe has_bias() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::test::GenericBiasedValueView::template OffsetStorageType> , typename Storage::template OffsetStorageType, 1, 8 , ::std::int32_t> values() const; - ::emboss::support::Maybe has_values() const; + [[nodiscard]] ::emboss::support::Maybe has_values() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -8667,17 +8341,17 @@ class GenericSizedArrayOfBiasedValuesView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -8690,12 +8364,12 @@ class GenericSizedArrayOfBiasedValuesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.element_count(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(::emboss::support::Maybe(static_cast(2LL)), emboss_reserved_local_subexpr_2); @@ -8705,7 +8379,7 @@ class GenericSizedArrayOfBiasedValuesView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -8713,8 +8387,8 @@ class GenericSizedArrayOfBiasedValuesView final { const GenericSizedArrayOfBiasedValuesView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -8730,9 +8404,9 @@ class GenericSizedArrayOfBiasedValuesView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -8741,13 +8415,13 @@ class GenericSizedArrayOfBiasedValuesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -8765,9 +8439,9 @@ class GenericSizedArrayOfBiasedValuesView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -8776,13 +8450,13 @@ class GenericSizedArrayOfBiasedValuesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -8813,7 +8487,7 @@ struct EmbossReservedInternalIsGenericSizedArrayOfBiasedValuesView< }; template -inline GenericSizedArrayOfBiasedValuesView< +[[nodiscard]] inline GenericSizedArrayOfBiasedValuesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -8828,7 +8502,7 @@ MakeSizedArrayOfBiasedValuesView( T &&emboss_reserved_local_arg) { } template -inline GenericSizedArrayOfBiasedValuesView> +[[nodiscard]] inline GenericSizedArrayOfBiasedValuesView> MakeSizedArrayOfBiasedValuesView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericSizedArrayOfBiasedValuesView>( @@ -8837,7 +8511,7 @@ MakeSizedArrayOfBiasedValuesView( T *emboss_reserved_local_data, } template -inline GenericSizedArrayOfBiasedValuesView< +[[nodiscard]] inline GenericSizedArrayOfBiasedValuesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedSizedArrayOfBiasedValuesView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/requires.emb.h b/testdata/golden_cpp/requires.emb.h index 1d2c250..82e7515 100644 --- a/testdata/golden_cpp/requires.emb.h +++ b/testdata/golden_cpp/requires.emb.h @@ -189,94 +189,46 @@ class GenericRequiresIntegersView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !zero_through_nine().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !ten_through_twenty().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !disjoint().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !ztn_plus_ttt().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !alias_of_zero_through_nine().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !zero_through_nine_plus_five().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!zero_through_nine().Ok()) return false; + if (!ten_through_twenty().Ok()) return false; + if (!disjoint().Ok()) return false; + if (!ztn_plus_ttt().Ok()) return false; + if (!alias_of_zero_through_nine().Ok()) return false; + if (!zero_through_nine_plus_five().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - if (!(::emboss::support::LessThanOrEqual((zero_through_nine().Ok() ? ::emboss::support::Maybe(static_cast(zero_through_nine().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Difference((ten_through_twenty().Ok() ? ::emboss::support::Maybe(static_cast(ten_through_twenty().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(10LL))))).ValueOr(false)) return false; return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericRequiresIntegersView emboss_reserved_local_other) const { if (!has_zero_through_nine().Known()) return false; @@ -331,7 +283,7 @@ class GenericRequiresIntegersView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericRequiresIntegersView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_zero_through_nine().ValueOr(false) && @@ -392,7 +344,7 @@ class GenericRequiresIntegersView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericRequiresIntegersView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -658,31 +610,31 @@ class GenericRequiresIntegersView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, RequiresIntegers::EmbossReservedValidatorForZeroThroughNine>, typename ::emboss::support::BitBlock>, 8>> zero_through_nine() const; - ::emboss::support::Maybe has_zero_through_nine() const; + [[nodiscard]] ::emboss::support::Maybe has_zero_through_nine() const; public: - typename ::emboss::prelude::IntView< + [[nodiscard]] typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<8, RequiresIntegers::EmbossReservedValidatorForTenThroughTwenty>, typename ::emboss::support::BitBlock>, 8>> ten_through_twenty() const; - ::emboss::support::Maybe has_ten_through_twenty() const; + [[nodiscard]] ::emboss::support::Maybe has_ten_through_twenty() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, RequiresIntegers::EmbossReservedValidatorForDisjoint>, typename ::emboss::support::BitBlock>, 8>> disjoint() const; - ::emboss::support::Maybe has_disjoint() const; + [[nodiscard]] ::emboss::support::Maybe has_disjoint() const; public: class EmbossReservedVirtualZtnPlusTttView final { @@ -701,17 +653,17 @@ class GenericRequiresIntegersView final { default; ~EmbossReservedVirtualZtnPlusTttView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_ztn_plus_ttt().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -724,12 +676,12 @@ class GenericRequiresIntegersView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.zero_through_nine(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = view_.ten_through_twenty(); @@ -739,7 +691,7 @@ class GenericRequiresIntegersView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::And(::emboss::support::LessThanOrEqual(::emboss::support::Maybe(static_cast(10LL)), ::emboss::support::Maybe(emboss_reserved_local_value)), ::emboss::support::LessThanOrEqual(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(19LL)))).ValueOr(false); @@ -747,8 +699,8 @@ class GenericRequiresIntegersView final { const GenericRequiresIntegersView view_; }; - EmbossReservedVirtualZtnPlusTttView ztn_plus_ttt() const; - ::emboss::support::Maybe has_ztn_plus_ttt() const; + [[nodiscard]] EmbossReservedVirtualZtnPlusTttView ztn_plus_ttt() const; + [[nodiscard]] ::emboss::support::Maybe has_ztn_plus_ttt() const; public: class EmbossReservedVirtualAliasOfZeroThroughNineView final { @@ -767,17 +719,17 @@ class GenericRequiresIntegersView final { default; ~EmbossReservedVirtualAliasOfZeroThroughNineView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_alias_of_zero_through_nine().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -790,9 +742,9 @@ class GenericRequiresIntegersView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } - bool TryToWrite(::std::int32_t emboss_reserved_local_value) { + [[nodiscard]] bool TryToWrite(::std::int32_t emboss_reserved_local_value) { const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Maybe(emboss_reserved_local_value); if (!CouldWriteValue(emboss_reserved_local_value)) return false; return view_.zero_through_nine().TryToWrite( @@ -806,7 +758,7 @@ class GenericRequiresIntegersView final { void UncheckedWrite(::std::int32_t emboss_reserved_local_value) { view_.zero_through_nine().UncheckedWrite((::emboss::support::Maybe(emboss_reserved_local_value)).ValueOrDefault()); } - bool CouldWriteValue(::std::int32_t emboss_reserved_local_value) { + [[nodiscard]] bool CouldWriteValue(::std::int32_t emboss_reserved_local_value) { if (!ValueIsOk(emboss_reserved_local_value)) return false; const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Maybe(emboss_reserved_local_value); if (!emboss_reserved_local_maybe_new_value.Known()) return false; @@ -822,14 +774,14 @@ class GenericRequiresIntegersView final { private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.zero_through_nine(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); return emboss_reserved_local_subexpr_2; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::And(::emboss::support::LessThanOrEqual(::emboss::support::Maybe(static_cast(2LL)), ::emboss::support::Maybe(emboss_reserved_local_value)), ::emboss::support::LessThanOrEqual(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(7LL)))).ValueOr(false); @@ -837,8 +789,8 @@ class GenericRequiresIntegersView final { const GenericRequiresIntegersView view_; }; - EmbossReservedVirtualAliasOfZeroThroughNineView alias_of_zero_through_nine() const; - ::emboss::support::Maybe has_alias_of_zero_through_nine() const; + [[nodiscard]] EmbossReservedVirtualAliasOfZeroThroughNineView alias_of_zero_through_nine() const; + [[nodiscard]] ::emboss::support::Maybe has_alias_of_zero_through_nine() const; public: class EmbossReservedVirtualZeroThroughNinePlusFiveView final { @@ -857,17 +809,17 @@ class GenericRequiresIntegersView final { default; ~EmbossReservedVirtualZeroThroughNinePlusFiveView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_zero_through_nine_plus_five().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -880,9 +832,9 @@ class GenericRequiresIntegersView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } - bool TryToWrite(::std::int32_t emboss_reserved_local_value) { + [[nodiscard]] bool TryToWrite(::std::int32_t emboss_reserved_local_value) { const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(5LL))); if (!CouldWriteValue(emboss_reserved_local_value)) return false; return view_.zero_through_nine().TryToWrite( @@ -896,7 +848,7 @@ class GenericRequiresIntegersView final { void UncheckedWrite(::std::int32_t emboss_reserved_local_value) { view_.zero_through_nine().UncheckedWrite((::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(5LL)))).ValueOrDefault()); } - bool CouldWriteValue(::std::int32_t emboss_reserved_local_value) { + [[nodiscard]] bool CouldWriteValue(::std::int32_t emboss_reserved_local_value) { if (!ValueIsOk(emboss_reserved_local_value)) return false; const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(5LL))); if (!emboss_reserved_local_maybe_new_value.Known()) return false; @@ -912,7 +864,7 @@ class GenericRequiresIntegersView final { private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.zero_through_nine(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(5LL))); @@ -920,7 +872,7 @@ class GenericRequiresIntegersView final { return emboss_reserved_local_subexpr_3; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::And(::emboss::support::LessThanOrEqual(::emboss::support::Maybe(static_cast(5LL)), ::emboss::support::Maybe(emboss_reserved_local_value)), ::emboss::support::LessThanOrEqual(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(10LL)))).ValueOr(false); @@ -928,8 +880,8 @@ class GenericRequiresIntegersView final { const GenericRequiresIntegersView view_; }; - EmbossReservedVirtualZeroThroughNinePlusFiveView zero_through_nine_plus_five() const; - ::emboss::support::Maybe has_zero_through_nine_plus_five() const; + [[nodiscard]] EmbossReservedVirtualZeroThroughNinePlusFiveView zero_through_nine_plus_five() const; + [[nodiscard]] ::emboss::support::Maybe has_zero_through_nine_plus_five() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -945,9 +897,9 @@ class GenericRequiresIntegersView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -956,13 +908,13 @@ class GenericRequiresIntegersView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -980,9 +932,9 @@ class GenericRequiresIntegersView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -991,13 +943,13 @@ class GenericRequiresIntegersView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1015,9 +967,9 @@ class GenericRequiresIntegersView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1026,13 +978,13 @@ class GenericRequiresIntegersView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1063,7 +1015,7 @@ struct EmbossReservedInternalIsGenericRequiresIntegersView< }; template -inline GenericRequiresIntegersView< +[[nodiscard]] inline GenericRequiresIntegersView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1078,7 +1030,7 @@ MakeRequiresIntegersView( T &&emboss_reserved_local_arg) { } template -inline GenericRequiresIntegersView> +[[nodiscard]] inline GenericRequiresIntegersView> MakeRequiresIntegersView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericRequiresIntegersView>( @@ -1087,7 +1039,7 @@ MakeRequiresIntegersView( T *emboss_reserved_local_data, } template -inline GenericRequiresIntegersView< +[[nodiscard]] inline GenericRequiresIntegersView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedRequiresIntegersView( T *emboss_reserved_local_data, @@ -1191,79 +1143,43 @@ class GenericEmbossReservedAnonymousField2View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !must_be_true().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !must_be_false().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a().Ok()) return false; + if (!b().Ok()) return false; + if (!must_be_true().Ok()) return false; + if (!must_be_false().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericEmbossReservedAnonymousField2View emboss_reserved_local_other) const { if (!has_a().Known()) return false; @@ -1335,7 +1251,7 @@ class GenericEmbossReservedAnonymousField2View final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericEmbossReservedAnonymousField2View emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_a().ValueOr(false) && @@ -1410,7 +1326,7 @@ class GenericEmbossReservedAnonymousField2View final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericEmbossReservedAnonymousField2View emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1619,39 +1535,39 @@ class GenericEmbossReservedAnonymousField2View final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> a() const; - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> b() const; - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, EmbossReservedAnonymousField2::EmbossReservedValidatorForMustBeTrue>, typename Storage::template OffsetStorageType> must_be_true() const; - ::emboss::support::Maybe has_must_be_true() const; + [[nodiscard]] ::emboss::support::Maybe has_must_be_true() const; public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, EmbossReservedAnonymousField2::EmbossReservedValidatorForMustBeFalse>, typename Storage::template OffsetStorageType> must_be_false() const; - ::emboss::support::Maybe has_must_be_false() const; + [[nodiscard]] ::emboss::support::Maybe has_must_be_false() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -1667,9 +1583,9 @@ class GenericEmbossReservedAnonymousField2View final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1678,13 +1594,13 @@ class GenericEmbossReservedAnonymousField2View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1702,9 +1618,9 @@ class GenericEmbossReservedAnonymousField2View final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1713,13 +1629,13 @@ class GenericEmbossReservedAnonymousField2View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1737,9 +1653,9 @@ class GenericEmbossReservedAnonymousField2View final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1748,13 +1664,13 @@ class GenericEmbossReservedAnonymousField2View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -1785,7 +1701,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField2View< }; template -inline GenericEmbossReservedAnonymousField2View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField2View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1800,7 +1716,7 @@ MakeEmbossReservedAnonymousField2View( T &&emboss_reserved_local_arg) { } template -inline GenericEmbossReservedAnonymousField2View> +[[nodiscard]] inline GenericEmbossReservedAnonymousField2View> MakeEmbossReservedAnonymousField2View( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericEmbossReservedAnonymousField2View>( @@ -1809,7 +1725,7 @@ MakeEmbossReservedAnonymousField2View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField2View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField2View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField2View( T *emboss_reserved_local_data, @@ -1870,102 +1786,54 @@ class GenericRequiresBoolsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_2().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !must_be_true().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !must_be_false().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b_must_be_false().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !alias_of_a_must_be_true().Ok()) return false; - } - + const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!emboss_reserved_anonymous_field_2().Ok()) return false; + if (!b_must_be_false().Ok()) return false; + if (!alias_of_a_must_be_true().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a().Ok()) return false; + if (!b().Ok()) return false; + if (!must_be_true().Ok()) return false; + if (!must_be_false().Ok()) return false; + } } - - if (!(::emboss::support::Or((a().Ok() ? ::emboss::support::Maybe(static_cast(a().UncheckedRead())) : ::emboss::support::Maybe()), (b().Ok() ? ::emboss::support::Maybe(static_cast(b().UncheckedRead())) : ::emboss::support::Maybe()))).ValueOr(false)) return false; return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericRequiresBoolsView emboss_reserved_local_other) const { if (!has_emboss_reserved_anonymous_field_2().Known()) return false; @@ -1986,7 +1854,7 @@ class GenericRequiresBoolsView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericRequiresBoolsView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_emboss_reserved_anonymous_field_2().ValueOr(false) && @@ -2019,7 +1887,7 @@ class GenericRequiresBoolsView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericRequiresBoolsView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -2285,41 +2153,41 @@ class GenericRequiresBoolsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } private: - typename ::emboss::test::RequiresBools::GenericEmbossReservedAnonymousField2View>, 8>> + [[nodiscard]] typename ::emboss::test::RequiresBools::GenericEmbossReservedAnonymousField2View>, 8>> emboss_reserved_anonymous_field_2() const; - ::emboss::support::Maybe has_emboss_reserved_anonymous_field_2() const; + [[nodiscard]] ::emboss::support::Maybe has_emboss_reserved_anonymous_field_2() const; public: - auto a() const -> decltype(this->emboss_reserved_anonymous_field_2().a()) { + [[nodiscard]] auto a() const -> decltype(this->emboss_reserved_anonymous_field_2().a()) { return has_a().ValueOrDefault() ? emboss_reserved_anonymous_field_2().a() : decltype(this->emboss_reserved_anonymous_field_2().a())(); } - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; public: - auto b() const -> decltype(this->emboss_reserved_anonymous_field_2().b()) { + [[nodiscard]] auto b() const -> decltype(this->emboss_reserved_anonymous_field_2().b()) { return has_b().ValueOrDefault() ? emboss_reserved_anonymous_field_2().b() : decltype(this->emboss_reserved_anonymous_field_2().b())(); } - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: - auto must_be_true() const -> decltype(this->emboss_reserved_anonymous_field_2().must_be_true()) { + [[nodiscard]] auto must_be_true() const -> decltype(this->emboss_reserved_anonymous_field_2().must_be_true()) { return has_must_be_true().ValueOrDefault() ? emboss_reserved_anonymous_field_2().must_be_true() : decltype(this->emboss_reserved_anonymous_field_2().must_be_true())(); } - ::emboss::support::Maybe has_must_be_true() const; + [[nodiscard]] ::emboss::support::Maybe has_must_be_true() const; public: - auto must_be_false() const -> decltype(this->emboss_reserved_anonymous_field_2().must_be_false()) { + [[nodiscard]] auto must_be_false() const -> decltype(this->emboss_reserved_anonymous_field_2().must_be_false()) { return has_must_be_false().ValueOrDefault() ? emboss_reserved_anonymous_field_2().must_be_false() : decltype(this->emboss_reserved_anonymous_field_2().must_be_false())(); } - ::emboss::support::Maybe has_must_be_false() const; + [[nodiscard]] ::emboss::support::Maybe has_must_be_false() const; public: class EmbossReservedVirtualBMustBeFalseView final { @@ -2338,17 +2206,17 @@ class GenericRequiresBoolsView final { default; ~EmbossReservedVirtualBMustBeFalseView() = default; - bool Read() const { + [[nodiscard]] bool Read() const { EMBOSS_CHECK(view_.has_b_must_be_false().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - bool UncheckedRead() const { + [[nodiscard]] bool UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -2361,12 +2229,12 @@ class GenericRequiresBoolsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.b(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(false)); @@ -2374,7 +2242,7 @@ class GenericRequiresBoolsView final { return emboss_reserved_local_subexpr_3; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( bool emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(emboss_reserved_local_value).ValueOr(false); @@ -2382,8 +2250,8 @@ class GenericRequiresBoolsView final { const GenericRequiresBoolsView view_; }; - EmbossReservedVirtualBMustBeFalseView b_must_be_false() const; - ::emboss::support::Maybe has_b_must_be_false() const; + [[nodiscard]] EmbossReservedVirtualBMustBeFalseView b_must_be_false() const; + [[nodiscard]] ::emboss::support::Maybe has_b_must_be_false() const; public: class EmbossReservedVirtualAliasOfAMustBeTrueView final { @@ -2402,17 +2270,17 @@ class GenericRequiresBoolsView final { default; ~EmbossReservedVirtualAliasOfAMustBeTrueView() = default; - bool Read() const { + [[nodiscard]] bool Read() const { EMBOSS_CHECK(view_.has_alias_of_a_must_be_true().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - bool UncheckedRead() const { + [[nodiscard]] bool UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -2425,9 +2293,9 @@ class GenericRequiresBoolsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } - bool TryToWrite(bool emboss_reserved_local_value) { + [[nodiscard]] bool TryToWrite(bool emboss_reserved_local_value) { const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Maybe(emboss_reserved_local_value); if (!CouldWriteValue(emboss_reserved_local_value)) return false; return view_.a().TryToWrite( @@ -2441,7 +2309,7 @@ class GenericRequiresBoolsView final { void UncheckedWrite(bool emboss_reserved_local_value) { view_.a().UncheckedWrite((::emboss::support::Maybe(emboss_reserved_local_value)).ValueOrDefault()); } - bool CouldWriteValue(bool emboss_reserved_local_value) { + [[nodiscard]] bool CouldWriteValue(bool emboss_reserved_local_value) { if (!ValueIsOk(emboss_reserved_local_value)) return false; const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Maybe(emboss_reserved_local_value); if (!emboss_reserved_local_maybe_new_value.Known()) return false; @@ -2457,14 +2325,14 @@ class GenericRequiresBoolsView final { private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.a(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); return emboss_reserved_local_subexpr_2; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( bool emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(emboss_reserved_local_value).ValueOr(false); @@ -2472,8 +2340,8 @@ class GenericRequiresBoolsView final { const GenericRequiresBoolsView view_; }; - EmbossReservedVirtualAliasOfAMustBeTrueView alias_of_a_must_be_true() const; - ::emboss::support::Maybe has_alias_of_a_must_be_true() const; + [[nodiscard]] EmbossReservedVirtualAliasOfAMustBeTrueView alias_of_a_must_be_true() const; + [[nodiscard]] ::emboss::support::Maybe has_alias_of_a_must_be_true() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -2489,9 +2357,9 @@ class GenericRequiresBoolsView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2500,13 +2368,13 @@ class GenericRequiresBoolsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2524,9 +2392,9 @@ class GenericRequiresBoolsView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2535,13 +2403,13 @@ class GenericRequiresBoolsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2559,9 +2427,9 @@ class GenericRequiresBoolsView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2570,13 +2438,13 @@ class GenericRequiresBoolsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2607,7 +2475,7 @@ struct EmbossReservedInternalIsGenericRequiresBoolsView< }; template -inline GenericRequiresBoolsView< +[[nodiscard]] inline GenericRequiresBoolsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2622,7 +2490,7 @@ MakeRequiresBoolsView( T &&emboss_reserved_local_arg) { } template -inline GenericRequiresBoolsView> +[[nodiscard]] inline GenericRequiresBoolsView> MakeRequiresBoolsView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericRequiresBoolsView>( @@ -2631,7 +2499,7 @@ MakeRequiresBoolsView( T *emboss_reserved_local_data, } template -inline GenericRequiresBoolsView< +[[nodiscard]] inline GenericRequiresBoolsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedRequiresBoolsView( T *emboss_reserved_local_data, @@ -2820,87 +2688,45 @@ class GenericRequiresEnumsView final { using Enum = ::emboss::test::RequiresEnums::Enum; - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !c().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !filtered_a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !alias_of_a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a().Ok()) return false; + if (!b().Ok()) return false; + if (!c().Ok()) return false; + if (!filtered_a().Ok()) return false; + if (!alias_of_a().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - if (!(::emboss::support::Or(::emboss::support::Equal((a().Ok() ? ::emboss::support::Maybe(static_cast(a().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0))), ::emboss::support::Equal((b().Ok() ? ::emboss::support::Maybe(static_cast(b().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0))))).ValueOr(false)) return false; return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericRequiresEnumsView emboss_reserved_local_other) const { if (!has_a().Known()) return false; @@ -2955,7 +2781,7 @@ class GenericRequiresEnumsView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericRequiresEnumsView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_a().ValueOr(false) && @@ -3016,7 +2842,7 @@ class GenericRequiresEnumsView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericRequiresEnumsView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -3244,34 +3070,34 @@ class GenericRequiresEnumsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::RequiresEnums::Enum, ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> a() const; - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::RequiresEnums::Enum, ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> b() const; - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::RequiresEnums::Enum, ::emboss::support::FixedSizeViewParameters<8, RequiresEnums::EmbossReservedValidatorForC>, typename ::emboss::support::BitBlock>, 8>> c() const; - ::emboss::support::Maybe has_c() const; + [[nodiscard]] ::emboss::support::Maybe has_c() const; public: class EmbossReservedVirtualFilteredAView final { @@ -3290,17 +3116,17 @@ class GenericRequiresEnumsView final { default; ~EmbossReservedVirtualFilteredAView() = default; - ::emboss::test::RequiresEnums::Enum Read() const { + [[nodiscard]] ::emboss::test::RequiresEnums::Enum Read() const { EMBOSS_CHECK(view_.has_filtered_a().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::emboss::test::RequiresEnums::Enum UncheckedRead() const { + [[nodiscard]] ::emboss::test::RequiresEnums::Enum UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -3313,12 +3139,12 @@ class GenericRequiresEnumsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.a(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(0))); @@ -3327,7 +3153,7 @@ class GenericRequiresEnumsView final { return emboss_reserved_local_subexpr_4; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::emboss::test::RequiresEnums::Enum emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Equal(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(1))).ValueOr(false); @@ -3335,8 +3161,8 @@ class GenericRequiresEnumsView final { const GenericRequiresEnumsView view_; }; - EmbossReservedVirtualFilteredAView filtered_a() const; - ::emboss::support::Maybe has_filtered_a() const; + [[nodiscard]] EmbossReservedVirtualFilteredAView filtered_a() const; + [[nodiscard]] ::emboss::support::Maybe has_filtered_a() const; public: class EmbossReservedVirtualAliasOfAView final { @@ -3355,17 +3181,17 @@ class GenericRequiresEnumsView final { default; ~EmbossReservedVirtualAliasOfAView() = default; - ::emboss::test::RequiresEnums::Enum Read() const { + [[nodiscard]] ::emboss::test::RequiresEnums::Enum Read() const { EMBOSS_CHECK(view_.has_alias_of_a().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::emboss::test::RequiresEnums::Enum UncheckedRead() const { + [[nodiscard]] ::emboss::test::RequiresEnums::Enum UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -3378,9 +3204,9 @@ class GenericRequiresEnumsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } - bool TryToWrite(::emboss::test::RequiresEnums::Enum emboss_reserved_local_value) { + [[nodiscard]] bool TryToWrite(::emboss::test::RequiresEnums::Enum emboss_reserved_local_value) { const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Maybe(emboss_reserved_local_value); if (!CouldWriteValue(emboss_reserved_local_value)) return false; return view_.a().TryToWrite( @@ -3394,7 +3220,7 @@ class GenericRequiresEnumsView final { void UncheckedWrite(::emboss::test::RequiresEnums::Enum emboss_reserved_local_value) { view_.a().UncheckedWrite((::emboss::support::Maybe(emboss_reserved_local_value)).ValueOrDefault()); } - bool CouldWriteValue(::emboss::test::RequiresEnums::Enum emboss_reserved_local_value) { + [[nodiscard]] bool CouldWriteValue(::emboss::test::RequiresEnums::Enum emboss_reserved_local_value) { if (!ValueIsOk(emboss_reserved_local_value)) return false; const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Maybe(emboss_reserved_local_value); if (!emboss_reserved_local_maybe_new_value.Known()) return false; @@ -3410,14 +3236,14 @@ class GenericRequiresEnumsView final { private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.a(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); return emboss_reserved_local_subexpr_2; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::emboss::test::RequiresEnums::Enum emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Equal(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(1))).ValueOr(false); @@ -3425,8 +3251,8 @@ class GenericRequiresEnumsView final { const GenericRequiresEnumsView view_; }; - EmbossReservedVirtualAliasOfAView alias_of_a() const; - ::emboss::support::Maybe has_alias_of_a() const; + [[nodiscard]] EmbossReservedVirtualAliasOfAView alias_of_a() const; + [[nodiscard]] ::emboss::support::Maybe has_alias_of_a() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -3442,9 +3268,9 @@ class GenericRequiresEnumsView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3453,13 +3279,13 @@ class GenericRequiresEnumsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3477,9 +3303,9 @@ class GenericRequiresEnumsView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3488,13 +3314,13 @@ class GenericRequiresEnumsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3512,9 +3338,9 @@ class GenericRequiresEnumsView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3523,13 +3349,13 @@ class GenericRequiresEnumsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3560,7 +3386,7 @@ struct EmbossReservedInternalIsGenericRequiresEnumsView< }; template -inline GenericRequiresEnumsView< +[[nodiscard]] inline GenericRequiresEnumsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3575,7 +3401,7 @@ MakeRequiresEnumsView( T &&emboss_reserved_local_arg) { } template -inline GenericRequiresEnumsView> +[[nodiscard]] inline GenericRequiresEnumsView> MakeRequiresEnumsView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericRequiresEnumsView>( @@ -3584,7 +3410,7 @@ MakeRequiresEnumsView( T *emboss_reserved_local_data, } template -inline GenericRequiresEnumsView< +[[nodiscard]] inline GenericRequiresEnumsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedRequiresEnumsView( T *emboss_reserved_local_data, @@ -3673,79 +3499,50 @@ class GenericEmbossReservedAnonymousField1View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - const auto emboss_reserved_local_ok_subexpr_1 = b_exists(); - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - + const auto emboss_reserved_local_ok_subexpr_1 = b_exists(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b_exists().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b_true().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a().Ok()) return false; + if (!b_exists().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_2; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!b().Ok()) return false; + if (!b_true().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - ::std::size_t SizeInBits() const { + [[nodiscard]] ::std::size_t SizeInBits() const { return static_cast(IntrinsicSizeInBits().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBits().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { if (!has_a().Known()) return false; @@ -3817,7 +3614,7 @@ class GenericEmbossReservedAnonymousField1View final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_a().ValueOr(false) && @@ -3892,7 +3689,7 @@ class GenericEmbossReservedAnonymousField1View final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -4101,39 +3898,39 @@ class GenericEmbossReservedAnonymousField1View final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> a() const; - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> b_exists() const; - ::emboss::support::Maybe has_b_exists() const; + [[nodiscard]] ::emboss::support::Maybe has_b_exists() const; public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> b() const; - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: - typename ::emboss::prelude::FlagView< + [[nodiscard]] typename ::emboss::prelude::FlagView< /**/ ::emboss::support::FixedSizeViewParameters<1, EmbossReservedAnonymousField1::EmbossReservedValidatorForBTrue>, typename Storage::template OffsetStorageType> b_true() const; - ::emboss::support::Maybe has_b_true() const; + [[nodiscard]] ::emboss::support::Maybe has_b_true() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -4152,17 +3949,17 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBits().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -4175,12 +3972,12 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.b_exists(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Choice(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(3LL)), ::emboss::support::Maybe(static_cast(0LL))); @@ -4189,7 +3986,7 @@ class GenericEmbossReservedAnonymousField1View final { return emboss_reserved_local_subexpr_4; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -4197,8 +3994,8 @@ class GenericEmbossReservedAnonymousField1View final { const GenericEmbossReservedAnonymousField1View view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() const; - ::emboss::support::Maybe has_IntrinsicSizeInBits() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBits() const; public: class EmbossReservedDollarVirtualMaxSizeInBitsView final { @@ -4214,9 +4011,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4225,13 +4022,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -4249,9 +4046,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4260,13 +4057,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -4297,7 +4094,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField1View< }; template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4312,7 +4109,7 @@ MakeEmbossReservedAnonymousField1View( T &&emboss_reserved_local_arg) { } template -inline GenericEmbossReservedAnonymousField1View> +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View> MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericEmbossReservedAnonymousField1View>( @@ -4321,7 +4118,7 @@ MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, @@ -4382,88 +4179,68 @@ class GenericRequiresWithOptionalFieldsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; - } - + const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); + const auto emboss_reserved_local_ok_subexpr_2 = emboss_reserved_anonymous_field_1().has_b(); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::And(::emboss::support::Maybe(true), emboss_reserved_local_ok_subexpr_2); + const auto emboss_reserved_local_ok_subexpr_4 = emboss_reserved_anonymous_field_1().has_b_true(); + const auto emboss_reserved_local_ok_subexpr_5 = ::emboss::support::And(::emboss::support::Maybe(true), emboss_reserved_local_ok_subexpr_4); { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = emboss_reserved_local_ok_subexpr_1; - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b_exists().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::Maybe(true), emboss_reserved_anonymous_field_1().has_b()); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::Maybe(true), emboss_reserved_anonymous_field_1().has_b_true()); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b_true().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!emboss_reserved_anonymous_field_1().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a().Ok()) return false; + if (!b_exists().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_3; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!b().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_5; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!b_true().Ok()) return false; + } } - - if (!(::emboss::support::Or((a().Ok() ? ::emboss::support::Maybe(static_cast(a().UncheckedRead())) : ::emboss::support::Maybe()), (b().Ok() ? ::emboss::support::Maybe(static_cast(b().UncheckedRead())) : ::emboss::support::Maybe()))).ValueOr(false)) return false; return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericRequiresWithOptionalFieldsView emboss_reserved_local_other) const { if (!has_emboss_reserved_anonymous_field_1().Known()) return false; @@ -4484,7 +4261,7 @@ class GenericRequiresWithOptionalFieldsView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericRequiresWithOptionalFieldsView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_emboss_reserved_anonymous_field_1().ValueOr(false) && @@ -4517,7 +4294,7 @@ class GenericRequiresWithOptionalFieldsView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericRequiresWithOptionalFieldsView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -4726,41 +4503,41 @@ class GenericRequiresWithOptionalFieldsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } private: - typename ::emboss::test::RequiresWithOptionalFields::GenericEmbossReservedAnonymousField1View>, 8>> + [[nodiscard]] typename ::emboss::test::RequiresWithOptionalFields::GenericEmbossReservedAnonymousField1View>, 8>> emboss_reserved_anonymous_field_1() const; - ::emboss::support::Maybe has_emboss_reserved_anonymous_field_1() const; + [[nodiscard]] ::emboss::support::Maybe has_emboss_reserved_anonymous_field_1() const; public: - auto a() const -> decltype(this->emboss_reserved_anonymous_field_1().a()) { + [[nodiscard]] auto a() const -> decltype(this->emboss_reserved_anonymous_field_1().a()) { return has_a().ValueOrDefault() ? emboss_reserved_anonymous_field_1().a() : decltype(this->emboss_reserved_anonymous_field_1().a())(); } - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; public: - auto b_exists() const -> decltype(this->emboss_reserved_anonymous_field_1().b_exists()) { + [[nodiscard]] auto b_exists() const -> decltype(this->emboss_reserved_anonymous_field_1().b_exists()) { return has_b_exists().ValueOrDefault() ? emboss_reserved_anonymous_field_1().b_exists() : decltype(this->emboss_reserved_anonymous_field_1().b_exists())(); } - ::emboss::support::Maybe has_b_exists() const; + [[nodiscard]] ::emboss::support::Maybe has_b_exists() const; public: - auto b() const -> decltype(this->emboss_reserved_anonymous_field_1().b()) { + [[nodiscard]] auto b() const -> decltype(this->emboss_reserved_anonymous_field_1().b()) { return has_b().ValueOrDefault() ? emboss_reserved_anonymous_field_1().b() : decltype(this->emboss_reserved_anonymous_field_1().b())(); } - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: - auto b_true() const -> decltype(this->emboss_reserved_anonymous_field_1().b_true()) { + [[nodiscard]] auto b_true() const -> decltype(this->emboss_reserved_anonymous_field_1().b_true()) { return has_b_true().ValueOrDefault() ? emboss_reserved_anonymous_field_1().b_true() : decltype(this->emboss_reserved_anonymous_field_1().b_true())(); } - ::emboss::support::Maybe has_b_true() const; + [[nodiscard]] ::emboss::support::Maybe has_b_true() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -4776,9 +4553,9 @@ class GenericRequiresWithOptionalFieldsView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4787,13 +4564,13 @@ class GenericRequiresWithOptionalFieldsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4811,9 +4588,9 @@ class GenericRequiresWithOptionalFieldsView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4822,13 +4599,13 @@ class GenericRequiresWithOptionalFieldsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4846,9 +4623,9 @@ class GenericRequiresWithOptionalFieldsView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4857,13 +4634,13 @@ class GenericRequiresWithOptionalFieldsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4894,7 +4671,7 @@ struct EmbossReservedInternalIsGenericRequiresWithOptionalFieldsView< }; template -inline GenericRequiresWithOptionalFieldsView< +[[nodiscard]] inline GenericRequiresWithOptionalFieldsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4909,7 +4686,7 @@ MakeRequiresWithOptionalFieldsView( T &&emboss_reserved_local_arg) { } template -inline GenericRequiresWithOptionalFieldsView> +[[nodiscard]] inline GenericRequiresWithOptionalFieldsView> MakeRequiresWithOptionalFieldsView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericRequiresWithOptionalFieldsView>( @@ -4918,7 +4695,7 @@ MakeRequiresWithOptionalFieldsView( T *emboss_reserved_local_data, } template -inline GenericRequiresWithOptionalFieldsView< +[[nodiscard]] inline GenericRequiresWithOptionalFieldsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedRequiresWithOptionalFieldsView( T *emboss_reserved_local_data, @@ -5000,58 +4777,40 @@ class GenericElementView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericElementView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -5072,7 +4831,7 @@ class GenericElementView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericElementView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -5105,7 +4864,7 @@ class GenericElementView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericElementView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -5200,15 +4959,15 @@ class GenericElementView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, Element::EmbossReservedValidatorForX>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -5224,9 +4983,9 @@ class GenericElementView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5235,13 +4994,13 @@ class GenericElementView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5259,9 +5018,9 @@ class GenericElementView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5270,13 +5029,13 @@ class GenericElementView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5294,9 +5053,9 @@ class GenericElementView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5305,13 +5064,13 @@ class GenericElementView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5342,7 +5101,7 @@ struct EmbossReservedInternalIsGenericElementView< }; template -inline GenericElementView< +[[nodiscard]] inline GenericElementView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5357,7 +5116,7 @@ MakeElementView( T &&emboss_reserved_local_arg) { } template -inline GenericElementView> +[[nodiscard]] inline GenericElementView> MakeElementView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericElementView>( @@ -5366,7 +5125,7 @@ MakeElementView( T *emboss_reserved_local_data, } template -inline GenericElementView< +[[nodiscard]] inline GenericElementView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedElementView( T *emboss_reserved_local_data, @@ -5427,58 +5186,40 @@ class GenericRequiresInArrayElementsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xs().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!xs().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericRequiresInArrayElementsView emboss_reserved_local_other) const { if (!has_xs().Known()) return false; @@ -5499,7 +5240,7 @@ class GenericRequiresInArrayElementsView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericRequiresInArrayElementsView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_xs().ValueOr(false) && @@ -5532,7 +5273,7 @@ class GenericRequiresInArrayElementsView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericRequiresInArrayElementsView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -5627,17 +5368,17 @@ class GenericRequiresInArrayElementsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::test::RequiresInArrayElements::GenericElementView::template OffsetStorageType> , typename Storage::template OffsetStorageType, 1, 8 > xs() const; - ::emboss::support::Maybe has_xs() const; + [[nodiscard]] ::emboss::support::Maybe has_xs() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -5653,9 +5394,9 @@ class GenericRequiresInArrayElementsView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5664,13 +5405,13 @@ class GenericRequiresInArrayElementsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5688,9 +5429,9 @@ class GenericRequiresInArrayElementsView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5699,13 +5440,13 @@ class GenericRequiresInArrayElementsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5723,9 +5464,9 @@ class GenericRequiresInArrayElementsView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5734,13 +5475,13 @@ class GenericRequiresInArrayElementsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5771,7 +5512,7 @@ struct EmbossReservedInternalIsGenericRequiresInArrayElementsView< }; template -inline GenericRequiresInArrayElementsView< +[[nodiscard]] inline GenericRequiresInArrayElementsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5786,7 +5527,7 @@ MakeRequiresInArrayElementsView( T &&emboss_reserved_local_arg) { } template -inline GenericRequiresInArrayElementsView> +[[nodiscard]] inline GenericRequiresInArrayElementsView> MakeRequiresInArrayElementsView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericRequiresInArrayElementsView>( @@ -5795,7 +5536,7 @@ MakeRequiresInArrayElementsView( T *emboss_reserved_local_data, } template -inline GenericRequiresInArrayElementsView< +[[nodiscard]] inline GenericRequiresInArrayElementsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedRequiresInArrayElementsView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/start_size_range.emb.h b/testdata/golden_cpp/start_size_range.emb.h index f4f3c71..34a58ab 100644 --- a/testdata/golden_cpp/start_size_range.emb.h +++ b/testdata/golden_cpp/start_size_range.emb.h @@ -90,78 +90,42 @@ class GenericStartSizeView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !size().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !start_size_constants().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !payload().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !counter().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!size().Ok()) return false; + if (!start_size_constants().Ok()) return false; + if (!payload().Ok()) return false; + if (!counter().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericStartSizeView emboss_reserved_local_other) const { if (!has_size().Known()) return false; @@ -233,7 +197,7 @@ class GenericStartSizeView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericStartSizeView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_size().ValueOr(false) && @@ -308,7 +272,7 @@ class GenericStartSizeView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericStartSizeView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -517,26 +481,26 @@ class GenericStartSizeView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> size() const; - ::emboss::support::Maybe has_size() const; + [[nodiscard]] ::emboss::support::Maybe has_size() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<16, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 16>> start_size_constants() const; - ::emboss::support::Maybe has_start_size_constants() const; + [[nodiscard]] ::emboss::support::Maybe has_start_size_constants() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 8>> @@ -545,15 +509,15 @@ class GenericStartSizeView final { 8 > payload() const; - ::emboss::support::Maybe has_payload() const; + [[nodiscard]] ::emboss::support::Maybe has_payload() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> counter() const; - ::emboss::support::Maybe has_counter() const; + [[nodiscard]] ::emboss::support::Maybe has_counter() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -572,17 +536,17 @@ class GenericStartSizeView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -595,12 +559,12 @@ class GenericStartSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.size(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(::emboss::support::Maybe(static_cast(3LL)), emboss_reserved_local_subexpr_2); @@ -612,7 +576,7 @@ class GenericStartSizeView final { return emboss_reserved_local_subexpr_7; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -620,8 +584,8 @@ class GenericStartSizeView final { const GenericStartSizeView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -637,9 +601,9 @@ class GenericStartSizeView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -648,13 +612,13 @@ class GenericStartSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -672,9 +636,9 @@ class GenericStartSizeView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -683,13 +647,13 @@ class GenericStartSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -720,7 +684,7 @@ struct EmbossReservedInternalIsGenericStartSizeView< }; template -inline GenericStartSizeView< +[[nodiscard]] inline GenericStartSizeView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -735,7 +699,7 @@ MakeStartSizeView( T &&emboss_reserved_local_arg) { } template -inline GenericStartSizeView> +[[nodiscard]] inline GenericStartSizeView> MakeStartSizeView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericStartSizeView>( @@ -744,7 +708,7 @@ MakeStartSizeView( T *emboss_reserved_local_data, } template -inline GenericStartSizeView< +[[nodiscard]] inline GenericStartSizeView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStartSizeView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/subtypes.emb.h b/testdata/golden_cpp/subtypes.emb.h index 5177de1..0987f5a 100644 --- a/testdata/golden_cpp/subtypes.emb.h +++ b/testdata/golden_cpp/subtypes.emb.h @@ -223,72 +223,42 @@ class GenericInInView final { using InInIn = ::emboss::test::Out::In::InIn::InInIn; - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !outer_offset().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !field_enum().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !in_2().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!outer_offset().Ok()) return false; + if (!field_enum().Ok()) return false; + if (!in_2().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericInInView emboss_reserved_local_other) const { if (!has_field_enum().Known()) return false; @@ -326,7 +296,7 @@ class GenericInInView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericInInView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_field_enum().ValueOr(false) && @@ -373,7 +343,7 @@ class GenericInInView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericInInView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -525,7 +495,7 @@ class GenericInInView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: class EmbossReservedVirtualOuterOffsetView final { @@ -541,9 +511,9 @@ class GenericInInView final { default; ~EmbossReservedVirtualOuterOffsetView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -552,30 +522,30 @@ class GenericInInView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedVirtualOuterOffsetView outer_offset() { + [[nodiscard]] static constexpr EmbossReservedVirtualOuterOffsetView outer_offset() { return EmbossReservedVirtualOuterOffsetView(); } - static constexpr ::emboss::support::Maybe has_outer_offset() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_outer_offset() { return ::emboss::support::Maybe(true); } public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::Out::In::InIn::InInIn, ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> field_enum() const; - ::emboss::support::Maybe has_field_enum() const; + [[nodiscard]] ::emboss::support::Maybe has_field_enum() const; public: - typename ::emboss::test::Out::GenericIn2View> + [[nodiscard]] typename ::emboss::test::Out::GenericIn2View> in_2() const; - ::emboss::support::Maybe has_in_2() const; + [[nodiscard]] ::emboss::support::Maybe has_in_2() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -591,9 +561,9 @@ class GenericInInView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -602,13 +572,13 @@ class GenericInInView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -626,9 +596,9 @@ class GenericInInView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -637,13 +607,13 @@ class GenericInInView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -661,9 +631,9 @@ class GenericInInView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -672,13 +642,13 @@ class GenericInInView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -709,7 +679,7 @@ struct EmbossReservedInternalIsGenericInInView< }; template -inline GenericInInView< +[[nodiscard]] inline GenericInInView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -724,7 +694,7 @@ MakeInInView( T &&emboss_reserved_local_arg) { } template -inline GenericInInView> +[[nodiscard]] inline GenericInInView> MakeInInView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericInInView>( @@ -733,7 +703,7 @@ MakeInInView( T *emboss_reserved_local_data, } template -inline GenericInInView< +[[nodiscard]] inline GenericInInView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedInInView( T *emboss_reserved_local_data, @@ -794,92 +764,44 @@ class GenericInView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !in_in_1().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !in_in_2().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !in_in_in_1().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !in_2().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !name_collision().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !name_collision_check().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!in_in_1().Ok()) return false; + if (!in_in_2().Ok()) return false; + if (!in_in_in_1().Ok()) return false; + if (!in_2().Ok()) return false; + if (!name_collision().Ok()) return false; + if (!name_collision_check().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericInView emboss_reserved_local_other) const { if (!has_in_in_1().Known()) return false; @@ -985,7 +907,7 @@ class GenericInView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericInView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_in_in_1().ValueOr(false) && @@ -1088,7 +1010,7 @@ class GenericInView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericInView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1373,50 +1295,50 @@ class GenericInView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::test::Out::In::GenericInInView> + [[nodiscard]] typename ::emboss::test::Out::In::GenericInInView> in_in_1() const; - ::emboss::support::Maybe has_in_in_1() const; + [[nodiscard]] ::emboss::support::Maybe has_in_in_1() const; public: - typename ::emboss::test::Out::In::GenericInInView> + [[nodiscard]] typename ::emboss::test::Out::In::GenericInInView> in_in_2() const; - ::emboss::support::Maybe has_in_in_2() const; + [[nodiscard]] ::emboss::support::Maybe has_in_in_2() const; public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::Out::In::InIn::InInIn, ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> in_in_in_1() const; - ::emboss::support::Maybe has_in_in_in_1() const; + [[nodiscard]] ::emboss::support::Maybe has_in_in_in_1() const; public: - typename ::emboss::test::Out::GenericIn2View> + [[nodiscard]] typename ::emboss::test::Out::GenericIn2View> in_2() const; - ::emboss::support::Maybe has_in_2() const; + [[nodiscard]] ::emboss::support::Maybe has_in_2() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> name_collision() const; - ::emboss::support::Maybe has_name_collision() const; + [[nodiscard]] ::emboss::support::Maybe has_name_collision() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> name_collision_check() const; - ::emboss::support::Maybe has_name_collision_check() const; + [[nodiscard]] ::emboss::support::Maybe has_name_collision_check() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -1435,17 +1357,17 @@ class GenericInView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -1458,12 +1380,12 @@ class GenericInView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.name_collision(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(1LL))); @@ -1473,7 +1395,7 @@ class GenericInView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -1481,8 +1403,8 @@ class GenericInView final { const GenericInView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -1498,9 +1420,9 @@ class GenericInView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1509,13 +1431,13 @@ class GenericInView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1533,9 +1455,9 @@ class GenericInView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1544,13 +1466,13 @@ class GenericInView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1581,7 +1503,7 @@ struct EmbossReservedInternalIsGenericInView< }; template -inline GenericInView< +[[nodiscard]] inline GenericInView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1596,7 +1518,7 @@ MakeInView( T &&emboss_reserved_local_arg) { } template -inline GenericInView> +[[nodiscard]] inline GenericInView> MakeInView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericInView>( @@ -1605,7 +1527,7 @@ MakeInView( T *emboss_reserved_local_data, } template -inline GenericInView< +[[nodiscard]] inline GenericInView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedInView( T *emboss_reserved_local_data, @@ -1671,58 +1593,40 @@ class GenericIn2View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !field_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!field_byte().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericIn2View emboss_reserved_local_other) const { if (!has_field_byte().Known()) return false; @@ -1743,7 +1647,7 @@ class GenericIn2View final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericIn2View emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_field_byte().ValueOr(false) && @@ -1776,7 +1680,7 @@ class GenericIn2View final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericIn2View emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1871,15 +1775,15 @@ class GenericIn2View final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> field_byte() const; - ::emboss::support::Maybe has_field_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_field_byte() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -1895,9 +1799,9 @@ class GenericIn2View final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1906,13 +1810,13 @@ class GenericIn2View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1930,9 +1834,9 @@ class GenericIn2View final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1941,13 +1845,13 @@ class GenericIn2View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1965,9 +1869,9 @@ class GenericIn2View final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1976,13 +1880,13 @@ class GenericIn2View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2013,7 +1917,7 @@ struct EmbossReservedInternalIsGenericIn2View< }; template -inline GenericIn2View< +[[nodiscard]] inline GenericIn2View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2028,7 +1932,7 @@ MakeIn2View( T &&emboss_reserved_local_arg) { } template -inline GenericIn2View> +[[nodiscard]] inline GenericIn2View> MakeIn2View( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericIn2View>( @@ -2037,7 +1941,7 @@ MakeIn2View( T *emboss_reserved_local_data, } template -inline GenericIn2View< +[[nodiscard]] inline GenericIn2View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedIn2View( T *emboss_reserved_local_data, @@ -2098,107 +2002,47 @@ class GenericOutView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !in_1().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !in_2().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !in_in_1().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !in_in_2().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !in_in_in_1().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !in_in_in_2().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !name_collision().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !nested_constant_check().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!in_1().Ok()) return false; + if (!in_2().Ok()) return false; + if (!in_in_1().Ok()) return false; + if (!in_in_2().Ok()) return false; + if (!in_in_in_1().Ok()) return false; + if (!in_in_in_2().Ok()) return false; + if (!name_collision().Ok()) return false; + if (!nested_constant_check().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericOutView emboss_reserved_local_other) const { if (!has_in_1().Known()) return false; @@ -2338,7 +2182,7 @@ class GenericOutView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericOutView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_in_1().ValueOr(false) && @@ -2469,7 +2313,7 @@ class GenericOutView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericOutView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -2830,65 +2674,65 @@ class GenericOutView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::test::Out::GenericInView> + [[nodiscard]] typename ::emboss::test::Out::GenericInView> in_1() const; - ::emboss::support::Maybe has_in_1() const; + [[nodiscard]] ::emboss::support::Maybe has_in_1() const; public: - typename ::emboss::test::Out::GenericInView> + [[nodiscard]] typename ::emboss::test::Out::GenericInView> in_2() const; - ::emboss::support::Maybe has_in_2() const; + [[nodiscard]] ::emboss::support::Maybe has_in_2() const; public: - typename ::emboss::test::Out::In::GenericInInView> + [[nodiscard]] typename ::emboss::test::Out::In::GenericInInView> in_in_1() const; - ::emboss::support::Maybe has_in_in_1() const; + [[nodiscard]] ::emboss::support::Maybe has_in_in_1() const; public: - typename ::emboss::test::Out::In::GenericInInView> + [[nodiscard]] typename ::emboss::test::Out::In::GenericInInView> in_in_2() const; - ::emboss::support::Maybe has_in_in_2() const; + [[nodiscard]] ::emboss::support::Maybe has_in_in_2() const; public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::Out::In::InIn::InInIn, ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> in_in_in_1() const; - ::emboss::support::Maybe has_in_in_in_1() const; + [[nodiscard]] ::emboss::support::Maybe has_in_in_in_1() const; public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::Out::In::InIn::InInIn, ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> in_in_in_2() const; - ::emboss::support::Maybe has_in_in_in_2() const; + [[nodiscard]] ::emboss::support::Maybe has_in_in_in_2() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<16, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 16>> name_collision() const; - ::emboss::support::Maybe has_name_collision() const; + [[nodiscard]] ::emboss::support::Maybe has_name_collision() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> nested_constant_check() const; - ::emboss::support::Maybe has_nested_constant_check() const; + [[nodiscard]] ::emboss::support::Maybe has_nested_constant_check() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -2904,9 +2748,9 @@ class GenericOutView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2915,13 +2759,13 @@ class GenericOutView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2939,9 +2783,9 @@ class GenericOutView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2950,13 +2794,13 @@ class GenericOutView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2974,9 +2818,9 @@ class GenericOutView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2985,13 +2829,13 @@ class GenericOutView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3022,7 +2866,7 @@ struct EmbossReservedInternalIsGenericOutView< }; template -inline GenericOutView< +[[nodiscard]] inline GenericOutView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3037,7 +2881,7 @@ MakeOutView( T &&emboss_reserved_local_arg) { } template -inline GenericOutView> +[[nodiscard]] inline GenericOutView> MakeOutView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericOutView>( @@ -3046,7 +2890,7 @@ MakeOutView( T *emboss_reserved_local_data, } template -inline GenericOutView< +[[nodiscard]] inline GenericOutView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedOutView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/text_format.emb.h b/testdata/golden_cpp/text_format.emb.h index 5103a11..b87a161 100644 --- a/testdata/golden_cpp/text_format.emb.h +++ b/testdata/golden_cpp/text_format.emb.h @@ -104,65 +104,41 @@ class GenericVanillaView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a().Ok()) return false; + if (!b().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericVanillaView emboss_reserved_local_other) const { if (!has_a().Known()) return false; @@ -200,7 +176,7 @@ class GenericVanillaView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericVanillaView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_a().ValueOr(false) && @@ -247,7 +223,7 @@ class GenericVanillaView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericVanillaView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -380,23 +356,23 @@ class GenericVanillaView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> a() const; - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> b() const; - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -412,9 +388,9 @@ class GenericVanillaView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -423,13 +399,13 @@ class GenericVanillaView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -447,9 +423,9 @@ class GenericVanillaView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -458,13 +434,13 @@ class GenericVanillaView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -482,9 +458,9 @@ class GenericVanillaView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -493,13 +469,13 @@ class GenericVanillaView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -530,7 +506,7 @@ struct EmbossReservedInternalIsGenericVanillaView< }; template -inline GenericVanillaView< +[[nodiscard]] inline GenericVanillaView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -545,7 +521,7 @@ MakeVanillaView( T &&emboss_reserved_local_arg) { } template -inline GenericVanillaView> +[[nodiscard]] inline GenericVanillaView> MakeVanillaView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericVanillaView>( @@ -554,7 +530,7 @@ MakeVanillaView( T *emboss_reserved_local_data, } template -inline GenericVanillaView< +[[nodiscard]] inline GenericVanillaView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedVanillaView( T *emboss_reserved_local_data, @@ -621,72 +597,42 @@ class GenericStructWithSkippedFieldsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !c().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a().Ok()) return false; + if (!b().Ok()) return false; + if (!c().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericStructWithSkippedFieldsView emboss_reserved_local_other) const { if (!has_a().Known()) return false; @@ -741,7 +687,7 @@ class GenericStructWithSkippedFieldsView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericStructWithSkippedFieldsView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_a().ValueOr(false) && @@ -802,7 +748,7 @@ class GenericStructWithSkippedFieldsView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericStructWithSkippedFieldsView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -943,31 +889,31 @@ class GenericStructWithSkippedFieldsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> a() const; - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> b() const; - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> c() const; - ::emboss::support::Maybe has_c() const; + [[nodiscard]] ::emboss::support::Maybe has_c() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -983,9 +929,9 @@ class GenericStructWithSkippedFieldsView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -994,13 +940,13 @@ class GenericStructWithSkippedFieldsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1018,9 +964,9 @@ class GenericStructWithSkippedFieldsView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1029,13 +975,13 @@ class GenericStructWithSkippedFieldsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1053,9 +999,9 @@ class GenericStructWithSkippedFieldsView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1064,13 +1010,13 @@ class GenericStructWithSkippedFieldsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1101,7 +1047,7 @@ struct EmbossReservedInternalIsGenericStructWithSkippedFieldsView< }; template -inline GenericStructWithSkippedFieldsView< +[[nodiscard]] inline GenericStructWithSkippedFieldsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1116,7 +1062,7 @@ MakeStructWithSkippedFieldsView( T &&emboss_reserved_local_arg) { } template -inline GenericStructWithSkippedFieldsView> +[[nodiscard]] inline GenericStructWithSkippedFieldsView> MakeStructWithSkippedFieldsView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericStructWithSkippedFieldsView>( @@ -1125,7 +1071,7 @@ MakeStructWithSkippedFieldsView( T *emboss_reserved_local_data, } template -inline GenericStructWithSkippedFieldsView< +[[nodiscard]] inline GenericStructWithSkippedFieldsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructWithSkippedFieldsView( T *emboss_reserved_local_data, @@ -1192,72 +1138,42 @@ class GenericStructWithSkippedStructureFieldsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !c().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a().Ok()) return false; + if (!b().Ok()) return false; + if (!c().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericStructWithSkippedStructureFieldsView emboss_reserved_local_other) const { if (!has_a().Known()) return false; @@ -1312,7 +1228,7 @@ class GenericStructWithSkippedStructureFieldsView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericStructWithSkippedStructureFieldsView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_a().ValueOr(false) && @@ -1373,7 +1289,7 @@ class GenericStructWithSkippedStructureFieldsView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericStructWithSkippedStructureFieldsView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1514,25 +1430,25 @@ class GenericStructWithSkippedStructureFieldsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::test::GenericVanillaView> + [[nodiscard]] typename ::emboss::test::GenericVanillaView> a() const; - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; public: - typename ::emboss::test::GenericVanillaView> + [[nodiscard]] typename ::emboss::test::GenericVanillaView> b() const; - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: - typename ::emboss::test::GenericVanillaView> + [[nodiscard]] typename ::emboss::test::GenericVanillaView> c() const; - ::emboss::support::Maybe has_c() const; + [[nodiscard]] ::emboss::support::Maybe has_c() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -1548,9 +1464,9 @@ class GenericStructWithSkippedStructureFieldsView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1559,13 +1475,13 @@ class GenericStructWithSkippedStructureFieldsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1583,9 +1499,9 @@ class GenericStructWithSkippedStructureFieldsView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1594,13 +1510,13 @@ class GenericStructWithSkippedStructureFieldsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1618,9 +1534,9 @@ class GenericStructWithSkippedStructureFieldsView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1629,13 +1545,13 @@ class GenericStructWithSkippedStructureFieldsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1666,7 +1582,7 @@ struct EmbossReservedInternalIsGenericStructWithSkippedStructureFieldsView< }; template -inline GenericStructWithSkippedStructureFieldsView< +[[nodiscard]] inline GenericStructWithSkippedStructureFieldsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1681,7 +1597,7 @@ MakeStructWithSkippedStructureFieldsView( T &&emboss_reserved_local_arg) { } template -inline GenericStructWithSkippedStructureFieldsView> +[[nodiscard]] inline GenericStructWithSkippedStructureFieldsView> MakeStructWithSkippedStructureFieldsView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericStructWithSkippedStructureFieldsView>( @@ -1690,7 +1606,7 @@ MakeStructWithSkippedStructureFieldsView( T *emboss_reserved_local_data, } template -inline GenericStructWithSkippedStructureFieldsView< +[[nodiscard]] inline GenericStructWithSkippedStructureFieldsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructWithSkippedStructureFieldsView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/uint_sizes.emb.h b/testdata/golden_cpp/uint_sizes.emb.h index 60c8780..e0c25d0 100644 --- a/testdata/golden_cpp/uint_sizes.emb.h +++ b/testdata/golden_cpp/uint_sizes.emb.h @@ -146,107 +146,47 @@ class GenericSizesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !two_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !three_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !four_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !five_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !six_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !seven_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !eight_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!one_byte().Ok()) return false; + if (!two_byte().Ok()) return false; + if (!three_byte().Ok()) return false; + if (!four_byte().Ok()) return false; + if (!five_byte().Ok()) return false; + if (!six_byte().Ok()) return false; + if (!seven_byte().Ok()) return false; + if (!eight_byte().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericSizesView emboss_reserved_local_other) const { if (!has_one_byte().Known()) return false; @@ -386,7 +326,7 @@ class GenericSizesView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericSizesView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_one_byte().ValueOr(false) && @@ -517,7 +457,7 @@ class GenericSizesView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericSizesView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -878,71 +818,71 @@ class GenericSizesView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> one_byte() const; - ::emboss::support::Maybe has_one_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_one_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<16, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 16>> two_byte() const; - ::emboss::support::Maybe has_two_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_two_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<24, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 24>> three_byte() const; - ::emboss::support::Maybe has_three_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_three_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> four_byte() const; - ::emboss::support::Maybe has_four_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_four_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<40, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 40>> five_byte() const; - ::emboss::support::Maybe has_five_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_five_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<48, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 48>> six_byte() const; - ::emboss::support::Maybe has_six_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_six_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<56, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 56>> seven_byte() const; - ::emboss::support::Maybe has_seven_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_seven_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<64, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 64>> eight_byte() const; - ::emboss::support::Maybe has_eight_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_eight_byte() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -958,9 +898,9 @@ class GenericSizesView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -969,13 +909,13 @@ class GenericSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -993,9 +933,9 @@ class GenericSizesView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1004,13 +944,13 @@ class GenericSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1028,9 +968,9 @@ class GenericSizesView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1039,13 +979,13 @@ class GenericSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1076,7 +1016,7 @@ struct EmbossReservedInternalIsGenericSizesView< }; template -inline GenericSizesView< +[[nodiscard]] inline GenericSizesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1091,7 +1031,7 @@ MakeSizesView( T &&emboss_reserved_local_arg) { } template -inline GenericSizesView> +[[nodiscard]] inline GenericSizesView> MakeSizesView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericSizesView>( @@ -1100,7 +1040,7 @@ MakeSizesView( T *emboss_reserved_local_data, } template -inline GenericSizesView< +[[nodiscard]] inline GenericSizesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedSizesView( T *emboss_reserved_local_data, @@ -1172,107 +1112,47 @@ class GenericBigEndianSizesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !two_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !three_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !four_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !five_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !six_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !seven_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !eight_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!one_byte().Ok()) return false; + if (!two_byte().Ok()) return false; + if (!three_byte().Ok()) return false; + if (!four_byte().Ok()) return false; + if (!five_byte().Ok()) return false; + if (!six_byte().Ok()) return false; + if (!seven_byte().Ok()) return false; + if (!eight_byte().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericBigEndianSizesView emboss_reserved_local_other) const { if (!has_one_byte().Known()) return false; @@ -1412,7 +1292,7 @@ class GenericBigEndianSizesView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericBigEndianSizesView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_one_byte().ValueOr(false) && @@ -1543,7 +1423,7 @@ class GenericBigEndianSizesView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericBigEndianSizesView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1904,71 +1784,71 @@ class GenericBigEndianSizesView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> one_byte() const; - ::emboss::support::Maybe has_one_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_one_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<16, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 16>> two_byte() const; - ::emboss::support::Maybe has_two_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_two_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<24, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 24>> three_byte() const; - ::emboss::support::Maybe has_three_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_three_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> four_byte() const; - ::emboss::support::Maybe has_four_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_four_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<40, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 40>> five_byte() const; - ::emboss::support::Maybe has_five_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_five_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<48, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 48>> six_byte() const; - ::emboss::support::Maybe has_six_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_six_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<56, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 56>> seven_byte() const; - ::emboss::support::Maybe has_seven_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_seven_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<64, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 64>> eight_byte() const; - ::emboss::support::Maybe has_eight_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_eight_byte() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -1984,9 +1864,9 @@ class GenericBigEndianSizesView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1995,13 +1875,13 @@ class GenericBigEndianSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2019,9 +1899,9 @@ class GenericBigEndianSizesView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2030,13 +1910,13 @@ class GenericBigEndianSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2054,9 +1934,9 @@ class GenericBigEndianSizesView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2065,13 +1945,13 @@ class GenericBigEndianSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2102,7 +1982,7 @@ struct EmbossReservedInternalIsGenericBigEndianSizesView< }; template -inline GenericBigEndianSizesView< +[[nodiscard]] inline GenericBigEndianSizesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2117,7 +1997,7 @@ MakeBigEndianSizesView( T &&emboss_reserved_local_arg) { } template -inline GenericBigEndianSizesView> +[[nodiscard]] inline GenericBigEndianSizesView> MakeBigEndianSizesView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericBigEndianSizesView>( @@ -2126,7 +2006,7 @@ MakeBigEndianSizesView( T *emboss_reserved_local_data, } template -inline GenericBigEndianSizesView< +[[nodiscard]] inline GenericBigEndianSizesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedBigEndianSizesView( T *emboss_reserved_local_data, @@ -2198,107 +2078,47 @@ class GenericAlternatingEndianSizesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !two_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !three_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !four_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !five_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !six_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !seven_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !eight_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!one_byte().Ok()) return false; + if (!two_byte().Ok()) return false; + if (!three_byte().Ok()) return false; + if (!four_byte().Ok()) return false; + if (!five_byte().Ok()) return false; + if (!six_byte().Ok()) return false; + if (!seven_byte().Ok()) return false; + if (!eight_byte().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericAlternatingEndianSizesView emboss_reserved_local_other) const { if (!has_one_byte().Known()) return false; @@ -2438,7 +2258,7 @@ class GenericAlternatingEndianSizesView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericAlternatingEndianSizesView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_one_byte().ValueOr(false) && @@ -2569,7 +2389,7 @@ class GenericAlternatingEndianSizesView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericAlternatingEndianSizesView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -2930,71 +2750,71 @@ class GenericAlternatingEndianSizesView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> one_byte() const; - ::emboss::support::Maybe has_one_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_one_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<16, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 16>> two_byte() const; - ::emboss::support::Maybe has_two_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_two_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<24, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 24>> three_byte() const; - ::emboss::support::Maybe has_three_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_three_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> four_byte() const; - ::emboss::support::Maybe has_four_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_four_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<40, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 40>> five_byte() const; - ::emboss::support::Maybe has_five_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_five_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<48, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 48>> six_byte() const; - ::emboss::support::Maybe has_six_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_six_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<56, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 56>> seven_byte() const; - ::emboss::support::Maybe has_seven_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_seven_byte() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<64, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 64>> eight_byte() const; - ::emboss::support::Maybe has_eight_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_eight_byte() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -3010,9 +2830,9 @@ class GenericAlternatingEndianSizesView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3021,13 +2841,13 @@ class GenericAlternatingEndianSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3045,9 +2865,9 @@ class GenericAlternatingEndianSizesView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3056,13 +2876,13 @@ class GenericAlternatingEndianSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3080,9 +2900,9 @@ class GenericAlternatingEndianSizesView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3091,13 +2911,13 @@ class GenericAlternatingEndianSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3128,7 +2948,7 @@ struct EmbossReservedInternalIsGenericAlternatingEndianSizesView< }; template -inline GenericAlternatingEndianSizesView< +[[nodiscard]] inline GenericAlternatingEndianSizesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3143,7 +2963,7 @@ MakeAlternatingEndianSizesView( T &&emboss_reserved_local_arg) { } template -inline GenericAlternatingEndianSizesView> +[[nodiscard]] inline GenericAlternatingEndianSizesView> MakeAlternatingEndianSizesView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericAlternatingEndianSizesView>( @@ -3152,7 +2972,7 @@ MakeAlternatingEndianSizesView( T *emboss_reserved_local_data, } template -inline GenericAlternatingEndianSizesView< +[[nodiscard]] inline GenericAlternatingEndianSizesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedAlternatingEndianSizesView( T *emboss_reserved_local_data, @@ -3224,107 +3044,47 @@ class GenericEnumSizesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !two_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !three_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !four_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !five_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !six_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !seven_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !eight_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!one_byte().Ok()) return false; + if (!two_byte().Ok()) return false; + if (!three_byte().Ok()) return false; + if (!four_byte().Ok()) return false; + if (!five_byte().Ok()) return false; + if (!six_byte().Ok()) return false; + if (!seven_byte().Ok()) return false; + if (!eight_byte().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericEnumSizesView emboss_reserved_local_other) const { if (!has_one_byte().Known()) return false; @@ -3464,7 +3224,7 @@ class GenericEnumSizesView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericEnumSizesView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_one_byte().ValueOr(false) && @@ -3595,7 +3355,7 @@ class GenericEnumSizesView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericEnumSizesView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -3956,79 +3716,79 @@ class GenericEnumSizesView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::Enum, ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> one_byte() const; - ::emboss::support::Maybe has_one_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_one_byte() const; public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::Enum, ::emboss::support::FixedSizeViewParameters<16, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 16>> two_byte() const; - ::emboss::support::Maybe has_two_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_two_byte() const; public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::Enum, ::emboss::support::FixedSizeViewParameters<24, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 24>> three_byte() const; - ::emboss::support::Maybe has_three_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_three_byte() const; public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::Enum, ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> four_byte() const; - ::emboss::support::Maybe has_four_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_four_byte() const; public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::Enum, ::emboss::support::FixedSizeViewParameters<40, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 40>> five_byte() const; - ::emboss::support::Maybe has_five_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_five_byte() const; public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::Enum, ::emboss::support::FixedSizeViewParameters<48, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 48>> six_byte() const; - ::emboss::support::Maybe has_six_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_six_byte() const; public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::Enum, ::emboss::support::FixedSizeViewParameters<56, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 56>> seven_byte() const; - ::emboss::support::Maybe has_seven_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_seven_byte() const; public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::Enum, ::emboss::support::FixedSizeViewParameters<64, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 64>> eight_byte() const; - ::emboss::support::Maybe has_eight_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_eight_byte() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -4044,9 +3804,9 @@ class GenericEnumSizesView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4055,13 +3815,13 @@ class GenericEnumSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4079,9 +3839,9 @@ class GenericEnumSizesView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4090,13 +3850,13 @@ class GenericEnumSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4114,9 +3874,9 @@ class GenericEnumSizesView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4125,13 +3885,13 @@ class GenericEnumSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4162,7 +3922,7 @@ struct EmbossReservedInternalIsGenericEnumSizesView< }; template -inline GenericEnumSizesView< +[[nodiscard]] inline GenericEnumSizesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4177,7 +3937,7 @@ MakeEnumSizesView( T &&emboss_reserved_local_arg) { } template -inline GenericEnumSizesView> +[[nodiscard]] inline GenericEnumSizesView> MakeEnumSizesView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericEnumSizesView>( @@ -4186,7 +3946,7 @@ MakeEnumSizesView( T *emboss_reserved_local_data, } template -inline GenericEnumSizesView< +[[nodiscard]] inline GenericEnumSizesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEnumSizesView( T *emboss_reserved_local_data, @@ -4259,58 +4019,40 @@ class GenericEmbossReservedAnonymousField1View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !three_and_a_half_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!three_and_a_half_byte().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { if (!has_three_and_a_half_byte().Known()) return false; @@ -4331,7 +4073,7 @@ class GenericEmbossReservedAnonymousField1View final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_three_and_a_half_byte().ValueOr(false) && @@ -4364,7 +4106,7 @@ class GenericEmbossReservedAnonymousField1View final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericEmbossReservedAnonymousField1View emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -4459,16 +4201,16 @@ class GenericEmbossReservedAnonymousField1View final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::ExplicitlySizedEnum, ::emboss::support::FixedSizeViewParameters<28, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> three_and_a_half_byte() const; - ::emboss::support::Maybe has_three_and_a_half_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_three_and_a_half_byte() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -4484,9 +4226,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4495,13 +4237,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -4519,9 +4261,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4530,13 +4272,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -4554,9 +4296,9 @@ class GenericEmbossReservedAnonymousField1View final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4565,13 +4307,13 @@ class GenericEmbossReservedAnonymousField1View final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -4602,7 +4344,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField1View< }; template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4617,7 +4359,7 @@ MakeEmbossReservedAnonymousField1View( T &&emboss_reserved_local_arg) { } template -inline GenericEmbossReservedAnonymousField1View> +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View> MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericEmbossReservedAnonymousField1View>( @@ -4626,7 +4368,7 @@ MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, @@ -4687,86 +4429,51 @@ class GenericExplicitlySizedEnumSizesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !two_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !three_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !emboss_reserved_anonymous_field_1().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::And(::emboss::support::Maybe(true), ::emboss::support::Maybe(true)); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !three_and_a_half_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!one_byte().Ok()) return false; + if (!two_byte().Ok()) return false; + if (!three_byte().Ok()) return false; + if (!emboss_reserved_anonymous_field_1().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_1; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!three_and_a_half_byte().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericExplicitlySizedEnumSizesView emboss_reserved_local_other) const { if (!has_one_byte().Known()) return false; @@ -4838,7 +4545,7 @@ class GenericExplicitlySizedEnumSizesView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericExplicitlySizedEnumSizesView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_one_byte().ValueOr(false) && @@ -4913,7 +4620,7 @@ class GenericExplicitlySizedEnumSizesView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericExplicitlySizedEnumSizesView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -5122,47 +4829,47 @@ class GenericExplicitlySizedEnumSizesView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::ExplicitlySizedEnum, ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> one_byte() const; - ::emboss::support::Maybe has_one_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_one_byte() const; public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::ExplicitlySizedEnum, ::emboss::support::FixedSizeViewParameters<16, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 16>> two_byte() const; - ::emboss::support::Maybe has_two_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_two_byte() const; public: - typename ::emboss::support::EnumView< + [[nodiscard]] typename ::emboss::support::EnumView< /**/ ::emboss::test::ExplicitlySizedEnum, ::emboss::support::FixedSizeViewParameters<24, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 24>> three_byte() const; - ::emboss::support::Maybe has_three_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_three_byte() const; private: - typename ::emboss::test::ExplicitlySizedEnumSizes::GenericEmbossReservedAnonymousField1View>, 32>> + [[nodiscard]] typename ::emboss::test::ExplicitlySizedEnumSizes::GenericEmbossReservedAnonymousField1View>, 32>> emboss_reserved_anonymous_field_1() const; - ::emboss::support::Maybe has_emboss_reserved_anonymous_field_1() const; + [[nodiscard]] ::emboss::support::Maybe has_emboss_reserved_anonymous_field_1() const; public: - auto three_and_a_half_byte() const -> decltype(this->emboss_reserved_anonymous_field_1().three_and_a_half_byte()) { + [[nodiscard]] auto three_and_a_half_byte() const -> decltype(this->emboss_reserved_anonymous_field_1().three_and_a_half_byte()) { return has_three_and_a_half_byte().ValueOrDefault() ? emboss_reserved_anonymous_field_1().three_and_a_half_byte() : decltype(this->emboss_reserved_anonymous_field_1().three_and_a_half_byte())(); } - ::emboss::support::Maybe has_three_and_a_half_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_three_and_a_half_byte() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -5178,9 +4885,9 @@ class GenericExplicitlySizedEnumSizesView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5189,13 +4896,13 @@ class GenericExplicitlySizedEnumSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5213,9 +4920,9 @@ class GenericExplicitlySizedEnumSizesView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5224,13 +4931,13 @@ class GenericExplicitlySizedEnumSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5248,9 +4955,9 @@ class GenericExplicitlySizedEnumSizesView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5259,13 +4966,13 @@ class GenericExplicitlySizedEnumSizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5296,7 +5003,7 @@ struct EmbossReservedInternalIsGenericExplicitlySizedEnumSizesView< }; template -inline GenericExplicitlySizedEnumSizesView< +[[nodiscard]] inline GenericExplicitlySizedEnumSizesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5311,7 +5018,7 @@ MakeExplicitlySizedEnumSizesView( T &&emboss_reserved_local_arg) { } template -inline GenericExplicitlySizedEnumSizesView> +[[nodiscard]] inline GenericExplicitlySizedEnumSizesView> MakeExplicitlySizedEnumSizesView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericExplicitlySizedEnumSizesView>( @@ -5320,7 +5027,7 @@ MakeExplicitlySizedEnumSizesView( T *emboss_reserved_local_data, } template -inline GenericExplicitlySizedEnumSizesView< +[[nodiscard]] inline GenericExplicitlySizedEnumSizesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedExplicitlySizedEnumSizesView( T *emboss_reserved_local_data, @@ -5686,107 +5393,47 @@ class GenericArraySizesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !one_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !two_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !three_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !four_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !five_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !six_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !seven_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !eight_byte().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!one_byte().Ok()) return false; + if (!two_byte().Ok()) return false; + if (!three_byte().Ok()) return false; + if (!four_byte().Ok()) return false; + if (!five_byte().Ok()) return false; + if (!six_byte().Ok()) return false; + if (!seven_byte().Ok()) return false; + if (!eight_byte().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericArraySizesView emboss_reserved_local_other) const { if (!has_one_byte().Known()) return false; @@ -5926,7 +5573,7 @@ class GenericArraySizesView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericArraySizesView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_one_byte().ValueOr(false) && @@ -6057,7 +5704,7 @@ class GenericArraySizesView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericArraySizesView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -6418,10 +6065,10 @@ class GenericArraySizesView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 8>> @@ -6430,10 +6077,10 @@ class GenericArraySizesView final { 8 > one_byte() const; - ::emboss::support::Maybe has_one_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_one_byte() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<16, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 16>> @@ -6442,10 +6089,10 @@ class GenericArraySizesView final { 8 > two_byte() const; - ::emboss::support::Maybe has_two_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_two_byte() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<24, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 24>> @@ -6454,10 +6101,10 @@ class GenericArraySizesView final { 8 > three_byte() const; - ::emboss::support::Maybe has_three_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_three_byte() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 32>> @@ -6466,10 +6113,10 @@ class GenericArraySizesView final { 8 > four_byte() const; - ::emboss::support::Maybe has_four_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_four_byte() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<40, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 40>> @@ -6478,10 +6125,10 @@ class GenericArraySizesView final { 8 > five_byte() const; - ::emboss::support::Maybe has_five_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_five_byte() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<48, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 48>> @@ -6490,10 +6137,10 @@ class GenericArraySizesView final { 8 > six_byte() const; - ::emboss::support::Maybe has_six_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_six_byte() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<56, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 56>> @@ -6502,10 +6149,10 @@ class GenericArraySizesView final { 8 > seven_byte() const; - ::emboss::support::Maybe has_seven_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_seven_byte() const; public: - typename ::emboss::support::GenericArrayView< + [[nodiscard]] typename ::emboss::support::GenericArrayView< typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<64, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock::template OffsetStorageType>, 64>> @@ -6514,7 +6161,7 @@ class GenericArraySizesView final { 8 > eight_byte() const; - ::emboss::support::Maybe has_eight_byte() const; + [[nodiscard]] ::emboss::support::Maybe has_eight_byte() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -6530,9 +6177,9 @@ class GenericArraySizesView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6541,13 +6188,13 @@ class GenericArraySizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -6565,9 +6212,9 @@ class GenericArraySizesView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6576,13 +6223,13 @@ class GenericArraySizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -6600,9 +6247,9 @@ class GenericArraySizesView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6611,13 +6258,13 @@ class GenericArraySizesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -6648,7 +6295,7 @@ struct EmbossReservedInternalIsGenericArraySizesView< }; template -inline GenericArraySizesView< +[[nodiscard]] inline GenericArraySizesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -6663,7 +6310,7 @@ MakeArraySizesView( T &&emboss_reserved_local_arg) { } template -inline GenericArraySizesView> +[[nodiscard]] inline GenericArraySizesView> MakeArraySizesView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericArraySizesView>( @@ -6672,7 +6319,7 @@ MakeArraySizesView( T *emboss_reserved_local_data, } template -inline GenericArraySizesView< +[[nodiscard]] inline GenericArraySizesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedArraySizesView( T *emboss_reserved_local_data, diff --git a/testdata/golden_cpp/virtual_field.emb.h b/testdata/golden_cpp/virtual_field.emb.h index d2544ed..81804fd 100644 --- a/testdata/golden_cpp/virtual_field.emb.h +++ b/testdata/golden_cpp/virtual_field.emb.h @@ -250,121 +250,49 @@ class GenericStructureWithConstantsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !ten().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !twenty().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !four_billion().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !ten_billion().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !minus_ten_billion().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !value().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !alias_of_value().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !alias_of_alias_of_value().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !alias_of_ten().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !alias_of_alias_of_ten().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!ten().Ok()) return false; + if (!twenty().Ok()) return false; + if (!four_billion().Ok()) return false; + if (!ten_billion().Ok()) return false; + if (!minus_ten_billion().Ok()) return false; + if (!value().Ok()) return false; + if (!alias_of_value().Ok()) return false; + if (!alias_of_alias_of_value().Ok()) return false; + if (!alias_of_ten().Ok()) return false; + if (!alias_of_alias_of_ten().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericStructureWithConstantsView emboss_reserved_local_other) const { if (!has_value().Known()) return false; @@ -385,7 +313,7 @@ class GenericStructureWithConstantsView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericStructureWithConstantsView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_value().ValueOr(false) && @@ -418,7 +346,7 @@ class GenericStructureWithConstantsView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericStructureWithConstantsView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -722,7 +650,7 @@ class GenericStructureWithConstantsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: class EmbossReservedVirtualTenView final { @@ -738,9 +666,9 @@ class GenericStructureWithConstantsView final { default; ~EmbossReservedVirtualTenView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -749,13 +677,13 @@ class GenericStructureWithConstantsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedVirtualTenView ten() { + [[nodiscard]] static constexpr EmbossReservedVirtualTenView ten() { return EmbossReservedVirtualTenView(); } - static constexpr ::emboss::support::Maybe has_ten() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_ten() { return ::emboss::support::Maybe(true); } @@ -773,9 +701,9 @@ class GenericStructureWithConstantsView final { default; ~EmbossReservedVirtualTwentyView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -784,13 +712,13 @@ class GenericStructureWithConstantsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedVirtualTwentyView twenty() { + [[nodiscard]] static constexpr EmbossReservedVirtualTwentyView twenty() { return EmbossReservedVirtualTwentyView(); } - static constexpr ::emboss::support::Maybe has_twenty() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_twenty() { return ::emboss::support::Maybe(true); } @@ -808,9 +736,9 @@ class GenericStructureWithConstantsView final { default; ~EmbossReservedVirtualFourBillionView() = default; - static constexpr ::std::uint32_t Read(); - static constexpr ::std::uint32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::uint32_t Read(); + [[nodiscard]] static constexpr ::std::uint32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -819,13 +747,13 @@ class GenericStructureWithConstantsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedVirtualFourBillionView four_billion() { + [[nodiscard]] static constexpr EmbossReservedVirtualFourBillionView four_billion() { return EmbossReservedVirtualFourBillionView(); } - static constexpr ::emboss::support::Maybe has_four_billion() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_four_billion() { return ::emboss::support::Maybe(true); } @@ -843,9 +771,9 @@ class GenericStructureWithConstantsView final { default; ~EmbossReservedVirtualTenBillionView() = default; - static constexpr ::std::int64_t Read(); - static constexpr ::std::int64_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int64_t Read(); + [[nodiscard]] static constexpr ::std::int64_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -854,13 +782,13 @@ class GenericStructureWithConstantsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedVirtualTenBillionView ten_billion() { + [[nodiscard]] static constexpr EmbossReservedVirtualTenBillionView ten_billion() { return EmbossReservedVirtualTenBillionView(); } - static constexpr ::emboss::support::Maybe has_ten_billion() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_ten_billion() { return ::emboss::support::Maybe(true); } @@ -878,9 +806,9 @@ class GenericStructureWithConstantsView final { default; ~EmbossReservedVirtualMinusTenBillionView() = default; - static constexpr ::std::int64_t Read(); - static constexpr ::std::int64_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int64_t Read(); + [[nodiscard]] static constexpr ::std::int64_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -889,37 +817,37 @@ class GenericStructureWithConstantsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedVirtualMinusTenBillionView minus_ten_billion() { + [[nodiscard]] static constexpr EmbossReservedVirtualMinusTenBillionView minus_ten_billion() { return EmbossReservedVirtualMinusTenBillionView(); } - static constexpr ::emboss::support::Maybe has_minus_ten_billion() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_minus_ten_billion() { return ::emboss::support::Maybe(true); } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> value() const; - ::emboss::support::Maybe has_value() const; + [[nodiscard]] ::emboss::support::Maybe has_value() const; public: - auto alias_of_value() const -> decltype(this->value()) { + [[nodiscard]] auto alias_of_value() const -> decltype(this->value()) { return has_alias_of_value().ValueOrDefault() ? value() : decltype(this->value())(); } - ::emboss::support::Maybe has_alias_of_value() const; + [[nodiscard]] ::emboss::support::Maybe has_alias_of_value() const; public: - auto alias_of_alias_of_value() const -> decltype(this->alias_of_value()) { + [[nodiscard]] auto alias_of_alias_of_value() const -> decltype(this->alias_of_value()) { return has_alias_of_alias_of_value().ValueOrDefault() ? alias_of_value() : decltype(this->alias_of_value())(); } - ::emboss::support::Maybe has_alias_of_alias_of_value() const; + [[nodiscard]] ::emboss::support::Maybe has_alias_of_alias_of_value() const; public: class EmbossReservedVirtualAliasOfTenView final { @@ -935,9 +863,9 @@ class GenericStructureWithConstantsView final { default; ~EmbossReservedVirtualAliasOfTenView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -946,13 +874,13 @@ class GenericStructureWithConstantsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedVirtualAliasOfTenView alias_of_ten() { + [[nodiscard]] static constexpr EmbossReservedVirtualAliasOfTenView alias_of_ten() { return EmbossReservedVirtualAliasOfTenView(); } - static constexpr ::emboss::support::Maybe has_alias_of_ten() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_alias_of_ten() { return ::emboss::support::Maybe(true); } @@ -970,9 +898,9 @@ class GenericStructureWithConstantsView final { default; ~EmbossReservedVirtualAliasOfAliasOfTenView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -981,13 +909,13 @@ class GenericStructureWithConstantsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedVirtualAliasOfAliasOfTenView alias_of_alias_of_ten() { + [[nodiscard]] static constexpr EmbossReservedVirtualAliasOfAliasOfTenView alias_of_alias_of_ten() { return EmbossReservedVirtualAliasOfAliasOfTenView(); } - static constexpr ::emboss::support::Maybe has_alias_of_alias_of_ten() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_alias_of_alias_of_ten() { return ::emboss::support::Maybe(true); } @@ -1005,9 +933,9 @@ class GenericStructureWithConstantsView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1016,13 +944,13 @@ class GenericStructureWithConstantsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1040,9 +968,9 @@ class GenericStructureWithConstantsView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1051,13 +979,13 @@ class GenericStructureWithConstantsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1075,9 +1003,9 @@ class GenericStructureWithConstantsView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -1086,13 +1014,13 @@ class GenericStructureWithConstantsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -1123,7 +1051,7 @@ struct EmbossReservedInternalIsGenericStructureWithConstantsView< }; template -inline GenericStructureWithConstantsView< +[[nodiscard]] inline GenericStructureWithConstantsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1138,7 +1066,7 @@ MakeStructureWithConstantsView( T &&emboss_reserved_local_arg) { } template -inline GenericStructureWithConstantsView> +[[nodiscard]] inline GenericStructureWithConstantsView> MakeStructureWithConstantsView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericStructureWithConstantsView>( @@ -1147,7 +1075,7 @@ MakeStructureWithConstantsView( T *emboss_reserved_local_data, } template -inline GenericStructureWithConstantsView< +[[nodiscard]] inline GenericStructureWithConstantsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructureWithConstantsView( T *emboss_reserved_local_data, @@ -1218,100 +1146,46 @@ class GenericStructureWithComputedValuesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !value().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !doubled().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !plus_ten().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !value2().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !signed_doubled().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !signed_plus_ten().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !product().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!value().Ok()) return false; + if (!doubled().Ok()) return false; + if (!plus_ten().Ok()) return false; + if (!value2().Ok()) return false; + if (!signed_doubled().Ok()) return false; + if (!signed_plus_ten().Ok()) return false; + if (!product().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericStructureWithComputedValuesView emboss_reserved_local_other) const { if (!has_value().Known()) return false; @@ -1349,7 +1223,7 @@ class GenericStructureWithComputedValuesView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericStructureWithComputedValuesView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_value().ValueOr(false) && @@ -1396,7 +1270,7 @@ class GenericStructureWithComputedValuesView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericStructureWithComputedValuesView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -1662,15 +1536,15 @@ class GenericStructureWithComputedValuesView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> value() const; - ::emboss::support::Maybe has_value() const; + [[nodiscard]] ::emboss::support::Maybe has_value() const; public: class EmbossReservedVirtualDoubledView final { @@ -1689,17 +1563,17 @@ class GenericStructureWithComputedValuesView final { default; ~EmbossReservedVirtualDoubledView() = default; - ::std::int64_t Read() const { + [[nodiscard]] ::std::int64_t Read() const { EMBOSS_CHECK(view_.has_doubled().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int64_t UncheckedRead() const { + [[nodiscard]] ::std::int64_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -1712,12 +1586,12 @@ class GenericStructureWithComputedValuesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.value(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Product(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(2LL))); @@ -1725,7 +1599,7 @@ class GenericStructureWithComputedValuesView final { return emboss_reserved_local_subexpr_3; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int64_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -1733,8 +1607,8 @@ class GenericStructureWithComputedValuesView final { const GenericStructureWithComputedValuesView view_; }; - EmbossReservedVirtualDoubledView doubled() const; - ::emboss::support::Maybe has_doubled() const; + [[nodiscard]] EmbossReservedVirtualDoubledView doubled() const; + [[nodiscard]] ::emboss::support::Maybe has_doubled() const; public: class EmbossReservedVirtualPlusTenView final { @@ -1753,17 +1627,17 @@ class GenericStructureWithComputedValuesView final { default; ~EmbossReservedVirtualPlusTenView() = default; - ::std::int64_t Read() const { + [[nodiscard]] ::std::int64_t Read() const { EMBOSS_CHECK(view_.has_plus_ten().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int64_t UncheckedRead() const { + [[nodiscard]] ::std::int64_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -1776,9 +1650,9 @@ class GenericStructureWithComputedValuesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } - bool TryToWrite(::std::int64_t emboss_reserved_local_value) { + [[nodiscard]] bool TryToWrite(::std::int64_t emboss_reserved_local_value) { const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(10LL))); if (!CouldWriteValue(emboss_reserved_local_value)) return false; return view_.value().TryToWrite( @@ -1792,7 +1666,7 @@ class GenericStructureWithComputedValuesView final { void UncheckedWrite(::std::int64_t emboss_reserved_local_value) { view_.value().UncheckedWrite((::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(10LL)))).ValueOrDefault()); } - bool CouldWriteValue(::std::int64_t emboss_reserved_local_value) { + [[nodiscard]] bool CouldWriteValue(::std::int64_t emboss_reserved_local_value) { if (!ValueIsOk(emboss_reserved_local_value)) return false; const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(10LL))); if (!emboss_reserved_local_maybe_new_value.Known()) return false; @@ -1808,7 +1682,7 @@ class GenericStructureWithComputedValuesView final { private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.value(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(10LL))); @@ -1816,7 +1690,7 @@ class GenericStructureWithComputedValuesView final { return emboss_reserved_local_subexpr_3; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int64_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -1824,16 +1698,16 @@ class GenericStructureWithComputedValuesView final { const GenericStructureWithComputedValuesView view_; }; - EmbossReservedVirtualPlusTenView plus_ten() const; - ::emboss::support::Maybe has_plus_ten() const; + [[nodiscard]] EmbossReservedVirtualPlusTenView plus_ten() const; + [[nodiscard]] ::emboss::support::Maybe has_plus_ten() const; public: - typename ::emboss::prelude::IntView< + [[nodiscard]] typename ::emboss::prelude::IntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> value2() const; - ::emboss::support::Maybe has_value2() const; + [[nodiscard]] ::emboss::support::Maybe has_value2() const; public: class EmbossReservedVirtualSignedDoubledView final { @@ -1852,17 +1726,17 @@ class GenericStructureWithComputedValuesView final { default; ~EmbossReservedVirtualSignedDoubledView() = default; - ::std::int64_t Read() const { + [[nodiscard]] ::std::int64_t Read() const { EMBOSS_CHECK(view_.has_signed_doubled().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int64_t UncheckedRead() const { + [[nodiscard]] ::std::int64_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -1875,12 +1749,12 @@ class GenericStructureWithComputedValuesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.value2(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Product(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(2LL))); @@ -1888,7 +1762,7 @@ class GenericStructureWithComputedValuesView final { return emboss_reserved_local_subexpr_3; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int64_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -1896,8 +1770,8 @@ class GenericStructureWithComputedValuesView final { const GenericStructureWithComputedValuesView view_; }; - EmbossReservedVirtualSignedDoubledView signed_doubled() const; - ::emboss::support::Maybe has_signed_doubled() const; + [[nodiscard]] EmbossReservedVirtualSignedDoubledView signed_doubled() const; + [[nodiscard]] ::emboss::support::Maybe has_signed_doubled() const; public: class EmbossReservedVirtualSignedPlusTenView final { @@ -1916,17 +1790,17 @@ class GenericStructureWithComputedValuesView final { default; ~EmbossReservedVirtualSignedPlusTenView() = default; - ::std::int64_t Read() const { + [[nodiscard]] ::std::int64_t Read() const { EMBOSS_CHECK(view_.has_signed_plus_ten().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int64_t UncheckedRead() const { + [[nodiscard]] ::std::int64_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -1939,9 +1813,9 @@ class GenericStructureWithComputedValuesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } - bool TryToWrite(::std::int64_t emboss_reserved_local_value) { + [[nodiscard]] bool TryToWrite(::std::int64_t emboss_reserved_local_value) { const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(10LL))); if (!CouldWriteValue(emboss_reserved_local_value)) return false; return view_.value2().TryToWrite( @@ -1955,7 +1829,7 @@ class GenericStructureWithComputedValuesView final { void UncheckedWrite(::std::int64_t emboss_reserved_local_value) { view_.value2().UncheckedWrite((::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(10LL)))).ValueOrDefault()); } - bool CouldWriteValue(::std::int64_t emboss_reserved_local_value) { + [[nodiscard]] bool CouldWriteValue(::std::int64_t emboss_reserved_local_value) { if (!ValueIsOk(emboss_reserved_local_value)) return false; const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(10LL))); if (!emboss_reserved_local_maybe_new_value.Known()) return false; @@ -1971,7 +1845,7 @@ class GenericStructureWithComputedValuesView final { private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.value2(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(10LL))); @@ -1979,7 +1853,7 @@ class GenericStructureWithComputedValuesView final { return emboss_reserved_local_subexpr_3; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int64_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -1987,8 +1861,8 @@ class GenericStructureWithComputedValuesView final { const GenericStructureWithComputedValuesView view_; }; - EmbossReservedVirtualSignedPlusTenView signed_plus_ten() const; - ::emboss::support::Maybe has_signed_plus_ten() const; + [[nodiscard]] EmbossReservedVirtualSignedPlusTenView signed_plus_ten() const; + [[nodiscard]] ::emboss::support::Maybe has_signed_plus_ten() const; public: class EmbossReservedVirtualProductView final { @@ -2007,17 +1881,17 @@ class GenericStructureWithComputedValuesView final { default; ~EmbossReservedVirtualProductView() = default; - ::std::int64_t Read() const { + [[nodiscard]] ::std::int64_t Read() const { EMBOSS_CHECK(view_.has_product().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int64_t UncheckedRead() const { + [[nodiscard]] ::std::int64_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -2030,12 +1904,12 @@ class GenericStructureWithComputedValuesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.value(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = view_.value2(); @@ -2045,7 +1919,7 @@ class GenericStructureWithComputedValuesView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int64_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -2053,8 +1927,8 @@ class GenericStructureWithComputedValuesView final { const GenericStructureWithComputedValuesView view_; }; - EmbossReservedVirtualProductView product() const; - ::emboss::support::Maybe has_product() const; + [[nodiscard]] EmbossReservedVirtualProductView product() const; + [[nodiscard]] ::emboss::support::Maybe has_product() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -2070,9 +1944,9 @@ class GenericStructureWithComputedValuesView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2081,13 +1955,13 @@ class GenericStructureWithComputedValuesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2105,9 +1979,9 @@ class GenericStructureWithComputedValuesView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2116,13 +1990,13 @@ class GenericStructureWithComputedValuesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2140,9 +2014,9 @@ class GenericStructureWithComputedValuesView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2151,13 +2025,13 @@ class GenericStructureWithComputedValuesView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2188,7 +2062,7 @@ struct EmbossReservedInternalIsGenericStructureWithComputedValuesView< }; template -inline GenericStructureWithComputedValuesView< +[[nodiscard]] inline GenericStructureWithComputedValuesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2203,7 +2077,7 @@ MakeStructureWithComputedValuesView( T &&emboss_reserved_local_arg) { } template -inline GenericStructureWithComputedValuesView> +[[nodiscard]] inline GenericStructureWithComputedValuesView> MakeStructureWithComputedValuesView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericStructureWithComputedValuesView>( @@ -2212,7 +2086,7 @@ MakeStructureWithComputedValuesView( T *emboss_reserved_local_data, } template -inline GenericStructureWithComputedValuesView< +[[nodiscard]] inline GenericStructureWithComputedValuesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructureWithComputedValuesView( T *emboss_reserved_local_data, @@ -2279,72 +2153,51 @@ class GenericStructureWithConditionalValueView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::LessThan(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(2147483648ULL))); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::LessThan((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(2147483648ULL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !two_x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x_plus_one().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!x_plus_one().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_3; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!two_x().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericStructureWithConditionalValueView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -2365,7 +2218,7 @@ class GenericStructureWithConditionalValueView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericStructureWithConditionalValueView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -2398,7 +2251,7 @@ class GenericStructureWithConditionalValueView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericStructureWithConditionalValueView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -2550,15 +2403,15 @@ class GenericStructureWithConditionalValueView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: class EmbossReservedVirtualTwoXView final { @@ -2577,17 +2430,17 @@ class GenericStructureWithConditionalValueView final { default; ~EmbossReservedVirtualTwoXView() = default; - ::std::int64_t Read() const { + [[nodiscard]] ::std::int64_t Read() const { EMBOSS_CHECK(view_.has_two_x().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int64_t UncheckedRead() const { + [[nodiscard]] ::std::int64_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -2600,12 +2453,12 @@ class GenericStructureWithConditionalValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Product(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(2LL))); @@ -2613,7 +2466,7 @@ class GenericStructureWithConditionalValueView final { return emboss_reserved_local_subexpr_3; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int64_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -2621,8 +2474,8 @@ class GenericStructureWithConditionalValueView final { const GenericStructureWithConditionalValueView view_; }; - EmbossReservedVirtualTwoXView two_x() const; - ::emboss::support::Maybe has_two_x() const; + [[nodiscard]] EmbossReservedVirtualTwoXView two_x() const; + [[nodiscard]] ::emboss::support::Maybe has_two_x() const; public: class EmbossReservedVirtualXPlusOneView final { @@ -2641,17 +2494,17 @@ class GenericStructureWithConditionalValueView final { default; ~EmbossReservedVirtualXPlusOneView() = default; - ::std::int64_t Read() const { + [[nodiscard]] ::std::int64_t Read() const { EMBOSS_CHECK(view_.has_x_plus_one().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int64_t UncheckedRead() const { + [[nodiscard]] ::std::int64_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -2664,9 +2517,9 @@ class GenericStructureWithConditionalValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } - bool TryToWrite(::std::int64_t emboss_reserved_local_value) { + [[nodiscard]] bool TryToWrite(::std::int64_t emboss_reserved_local_value) { const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(1LL))); if (!CouldWriteValue(emboss_reserved_local_value)) return false; return view_.x().TryToWrite( @@ -2680,7 +2533,7 @@ class GenericStructureWithConditionalValueView final { void UncheckedWrite(::std::int64_t emboss_reserved_local_value) { view_.x().UncheckedWrite((::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(1LL)))).ValueOrDefault()); } - bool CouldWriteValue(::std::int64_t emboss_reserved_local_value) { + [[nodiscard]] bool CouldWriteValue(::std::int64_t emboss_reserved_local_value) { if (!ValueIsOk(emboss_reserved_local_value)) return false; const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(1LL))); if (!emboss_reserved_local_maybe_new_value.Known()) return false; @@ -2696,7 +2549,7 @@ class GenericStructureWithConditionalValueView final { private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(1LL))); @@ -2704,7 +2557,7 @@ class GenericStructureWithConditionalValueView final { return emboss_reserved_local_subexpr_3; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int64_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -2712,8 +2565,8 @@ class GenericStructureWithConditionalValueView final { const GenericStructureWithConditionalValueView view_; }; - EmbossReservedVirtualXPlusOneView x_plus_one() const; - ::emboss::support::Maybe has_x_plus_one() const; + [[nodiscard]] EmbossReservedVirtualXPlusOneView x_plus_one() const; + [[nodiscard]] ::emboss::support::Maybe has_x_plus_one() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -2729,9 +2582,9 @@ class GenericStructureWithConditionalValueView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2740,13 +2593,13 @@ class GenericStructureWithConditionalValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2764,9 +2617,9 @@ class GenericStructureWithConditionalValueView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2775,13 +2628,13 @@ class GenericStructureWithConditionalValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2799,9 +2652,9 @@ class GenericStructureWithConditionalValueView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -2810,13 +2663,13 @@ class GenericStructureWithConditionalValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -2847,7 +2700,7 @@ struct EmbossReservedInternalIsGenericStructureWithConditionalValueView< }; template -inline GenericStructureWithConditionalValueView< +[[nodiscard]] inline GenericStructureWithConditionalValueView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2862,7 +2715,7 @@ MakeStructureWithConditionalValueView( T &&emboss_reserved_local_arg) { } template -inline GenericStructureWithConditionalValueView> +[[nodiscard]] inline GenericStructureWithConditionalValueView> MakeStructureWithConditionalValueView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericStructureWithConditionalValueView>( @@ -2871,7 +2724,7 @@ MakeStructureWithConditionalValueView( T *emboss_reserved_local_data, } template -inline GenericStructureWithConditionalValueView< +[[nodiscard]] inline GenericStructureWithConditionalValueView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructureWithConditionalValueView( T *emboss_reserved_local_data, @@ -2938,71 +2791,50 @@ class GenericStructureWithValueInConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = two_x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::LessThan(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(100LL))); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !two_x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::LessThan((two_x().Ok() ? ::emboss::support::Maybe(static_cast(two_x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(100LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !if_two_x_lt_100().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!two_x().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_3; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!if_two_x_lt_100().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericStructureWithValueInConditionView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -3040,7 +2872,7 @@ class GenericStructureWithValueInConditionView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericStructureWithValueInConditionView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -3087,7 +2919,7 @@ class GenericStructureWithValueInConditionView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericStructureWithValueInConditionView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -3239,15 +3071,15 @@ class GenericStructureWithValueInConditionView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: class EmbossReservedVirtualTwoXView final { @@ -3266,17 +3098,17 @@ class GenericStructureWithValueInConditionView final { default; ~EmbossReservedVirtualTwoXView() = default; - ::std::int64_t Read() const { + [[nodiscard]] ::std::int64_t Read() const { EMBOSS_CHECK(view_.has_two_x().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int64_t UncheckedRead() const { + [[nodiscard]] ::std::int64_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -3289,12 +3121,12 @@ class GenericStructureWithValueInConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Product(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(2LL))); @@ -3302,7 +3134,7 @@ class GenericStructureWithValueInConditionView final { return emboss_reserved_local_subexpr_3; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int64_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -3310,16 +3142,16 @@ class GenericStructureWithValueInConditionView final { const GenericStructureWithValueInConditionView view_; }; - EmbossReservedVirtualTwoXView two_x() const; - ::emboss::support::Maybe has_two_x() const; + [[nodiscard]] EmbossReservedVirtualTwoXView two_x() const; + [[nodiscard]] ::emboss::support::Maybe has_two_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> if_two_x_lt_100() const; - ::emboss::support::Maybe has_if_two_x_lt_100() const; + [[nodiscard]] ::emboss::support::Maybe has_if_two_x_lt_100() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -3338,17 +3170,17 @@ class GenericStructureWithValueInConditionView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -3361,12 +3193,12 @@ class GenericStructureWithValueInConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.two_x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::LessThan(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(100LL))); @@ -3376,7 +3208,7 @@ class GenericStructureWithValueInConditionView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -3384,8 +3216,8 @@ class GenericStructureWithValueInConditionView final { const GenericStructureWithValueInConditionView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -3401,9 +3233,9 @@ class GenericStructureWithValueInConditionView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3412,13 +3244,13 @@ class GenericStructureWithValueInConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3436,9 +3268,9 @@ class GenericStructureWithValueInConditionView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -3447,13 +3279,13 @@ class GenericStructureWithValueInConditionView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -3484,7 +3316,7 @@ struct EmbossReservedInternalIsGenericStructureWithValueInConditionView< }; template -inline GenericStructureWithValueInConditionView< +[[nodiscard]] inline GenericStructureWithValueInConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3499,7 +3331,7 @@ MakeStructureWithValueInConditionView( T &&emboss_reserved_local_arg) { } template -inline GenericStructureWithValueInConditionView> +[[nodiscard]] inline GenericStructureWithValueInConditionView> MakeStructureWithValueInConditionView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericStructureWithValueInConditionView>( @@ -3508,7 +3340,7 @@ MakeStructureWithValueInConditionView( T *emboss_reserved_local_data, } template -inline GenericStructureWithValueInConditionView< +[[nodiscard]] inline GenericStructureWithValueInConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructureWithValueInConditionView( T *emboss_reserved_local_data, @@ -3576,78 +3408,42 @@ class GenericStructureWithValuesInLocationView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !two_x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !offset_two_x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !size_two_x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!two_x().Ok()) return false; + if (!offset_two_x().Ok()) return false; + if (!size_two_x().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericStructureWithValuesInLocationView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -3702,7 +3498,7 @@ class GenericStructureWithValuesInLocationView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericStructureWithValuesInLocationView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -3763,7 +3559,7 @@ class GenericStructureWithValuesInLocationView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericStructureWithValuesInLocationView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -3953,15 +3749,15 @@ class GenericStructureWithValuesInLocationView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: class EmbossReservedVirtualTwoXView final { @@ -3980,17 +3776,17 @@ class GenericStructureWithValuesInLocationView final { default; ~EmbossReservedVirtualTwoXView() = default; - ::std::int64_t Read() const { + [[nodiscard]] ::std::int64_t Read() const { EMBOSS_CHECK(view_.has_two_x().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int64_t UncheckedRead() const { + [[nodiscard]] ::std::int64_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -4003,12 +3799,12 @@ class GenericStructureWithValuesInLocationView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Product(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(2LL))); @@ -4016,7 +3812,7 @@ class GenericStructureWithValuesInLocationView final { return emboss_reserved_local_subexpr_3; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int64_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -4024,24 +3820,24 @@ class GenericStructureWithValuesInLocationView final { const GenericStructureWithValuesInLocationView view_; }; - EmbossReservedVirtualTwoXView two_x() const; - ::emboss::support::Maybe has_two_x() const; + [[nodiscard]] EmbossReservedVirtualTwoXView two_x() const; + [[nodiscard]] ::emboss::support::Maybe has_two_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> offset_two_x() const; - ::emboss::support::Maybe has_offset_two_x() const; + [[nodiscard]] ::emboss::support::Maybe has_offset_two_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> size_two_x() const; - ::emboss::support::Maybe has_size_two_x() const; + [[nodiscard]] ::emboss::support::Maybe has_size_two_x() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -4060,17 +3856,17 @@ class GenericStructureWithValuesInLocationView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int64_t Read() const { + [[nodiscard]] ::std::int64_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int64_t UncheckedRead() const { + [[nodiscard]] ::std::int64_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -4083,12 +3879,12 @@ class GenericStructureWithValuesInLocationView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.two_x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(4LL))); @@ -4100,7 +3896,7 @@ class GenericStructureWithValuesInLocationView final { return emboss_reserved_local_subexpr_7; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int64_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -4108,8 +3904,8 @@ class GenericStructureWithValuesInLocationView final { const GenericStructureWithValuesInLocationView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -4125,9 +3921,9 @@ class GenericStructureWithValuesInLocationView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int64_t Read(); - static constexpr ::std::int64_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int64_t Read(); + [[nodiscard]] static constexpr ::std::int64_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4136,13 +3932,13 @@ class GenericStructureWithValuesInLocationView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4160,9 +3956,9 @@ class GenericStructureWithValuesInLocationView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4171,13 +3967,13 @@ class GenericStructureWithValuesInLocationView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4208,7 +4004,7 @@ struct EmbossReservedInternalIsGenericStructureWithValuesInLocationView< }; template -inline GenericStructureWithValuesInLocationView< +[[nodiscard]] inline GenericStructureWithValuesInLocationView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4223,7 +4019,7 @@ MakeStructureWithValuesInLocationView( T &&emboss_reserved_local_arg) { } template -inline GenericStructureWithValuesInLocationView> +[[nodiscard]] inline GenericStructureWithValuesInLocationView> MakeStructureWithValuesInLocationView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericStructureWithValuesInLocationView>( @@ -4232,7 +4028,7 @@ MakeStructureWithValuesInLocationView( T *emboss_reserved_local_data, } template -inline GenericStructureWithValuesInLocationView< +[[nodiscard]] inline GenericStructureWithValuesInLocationView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructureWithValuesInLocationView( T *emboss_reserved_local_data, @@ -4298,65 +4094,41 @@ class GenericStructureWithBoolValueView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x_is_ten().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!x_is_ten().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericStructureWithBoolValueView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -4377,7 +4149,7 @@ class GenericStructureWithBoolValueView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericStructureWithBoolValueView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -4410,7 +4182,7 @@ class GenericStructureWithBoolValueView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericStructureWithBoolValueView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -4524,15 +4296,15 @@ class GenericStructureWithBoolValueView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: class EmbossReservedVirtualXIsTenView final { @@ -4551,17 +4323,17 @@ class GenericStructureWithBoolValueView final { default; ~EmbossReservedVirtualXIsTenView() = default; - bool Read() const { + [[nodiscard]] bool Read() const { EMBOSS_CHECK(view_.has_x_is_ten().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - bool UncheckedRead() const { + [[nodiscard]] bool UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -4574,12 +4346,12 @@ class GenericStructureWithBoolValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(10LL))); @@ -4587,7 +4359,7 @@ class GenericStructureWithBoolValueView final { return emboss_reserved_local_subexpr_3; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( bool emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -4595,8 +4367,8 @@ class GenericStructureWithBoolValueView final { const GenericStructureWithBoolValueView view_; }; - EmbossReservedVirtualXIsTenView x_is_ten() const; - ::emboss::support::Maybe has_x_is_ten() const; + [[nodiscard]] EmbossReservedVirtualXIsTenView x_is_ten() const; + [[nodiscard]] ::emboss::support::Maybe has_x_is_ten() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -4612,9 +4384,9 @@ class GenericStructureWithBoolValueView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4623,13 +4395,13 @@ class GenericStructureWithBoolValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4647,9 +4419,9 @@ class GenericStructureWithBoolValueView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4658,13 +4430,13 @@ class GenericStructureWithBoolValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4682,9 +4454,9 @@ class GenericStructureWithBoolValueView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -4693,13 +4465,13 @@ class GenericStructureWithBoolValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -4730,7 +4502,7 @@ struct EmbossReservedInternalIsGenericStructureWithBoolValueView< }; template -inline GenericStructureWithBoolValueView< +[[nodiscard]] inline GenericStructureWithBoolValueView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4745,7 +4517,7 @@ MakeStructureWithBoolValueView( T &&emboss_reserved_local_arg) { } template -inline GenericStructureWithBoolValueView> +[[nodiscard]] inline GenericStructureWithBoolValueView> MakeStructureWithBoolValueView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericStructureWithBoolValueView>( @@ -4754,7 +4526,7 @@ MakeStructureWithBoolValueView( T *emboss_reserved_local_data, } template -inline GenericStructureWithBoolValueView< +[[nodiscard]] inline GenericStructureWithBoolValueView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructureWithBoolValueView( T *emboss_reserved_local_data, @@ -4907,65 +4679,41 @@ class GenericStructureWithEnumValueView final { using Category = ::emboss::test::StructureWithEnumValue::Category; - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x_size().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!x_size().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericStructureWithEnumValueView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -4986,7 +4734,7 @@ class GenericStructureWithEnumValueView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericStructureWithEnumValueView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -5019,7 +4767,7 @@ class GenericStructureWithEnumValueView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericStructureWithEnumValueView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -5133,15 +4881,15 @@ class GenericStructureWithEnumValueView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: class EmbossReservedVirtualXSizeView final { @@ -5160,17 +4908,17 @@ class GenericStructureWithEnumValueView final { default; ~EmbossReservedVirtualXSizeView() = default; - ::emboss::test::StructureWithEnumValue::Category Read() const { + [[nodiscard]] ::emboss::test::StructureWithEnumValue::Category Read() const { EMBOSS_CHECK(view_.has_x_size().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::emboss::test::StructureWithEnumValue::Category UncheckedRead() const { + [[nodiscard]] ::emboss::test::StructureWithEnumValue::Category UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -5183,12 +4931,12 @@ class GenericStructureWithEnumValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::LessThan(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(100LL))); @@ -5197,7 +4945,7 @@ class GenericStructureWithEnumValueView final { return emboss_reserved_local_subexpr_4; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::emboss::test::StructureWithEnumValue::Category emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -5205,8 +4953,8 @@ class GenericStructureWithEnumValueView final { const GenericStructureWithEnumValueView view_; }; - EmbossReservedVirtualXSizeView x_size() const; - ::emboss::support::Maybe has_x_size() const; + [[nodiscard]] EmbossReservedVirtualXSizeView x_size() const; + [[nodiscard]] ::emboss::support::Maybe has_x_size() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -5222,9 +4970,9 @@ class GenericStructureWithEnumValueView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5233,13 +4981,13 @@ class GenericStructureWithEnumValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5257,9 +5005,9 @@ class GenericStructureWithEnumValueView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5268,13 +5016,13 @@ class GenericStructureWithEnumValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5292,9 +5040,9 @@ class GenericStructureWithEnumValueView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5303,13 +5051,13 @@ class GenericStructureWithEnumValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5340,7 +5088,7 @@ struct EmbossReservedInternalIsGenericStructureWithEnumValueView< }; template -inline GenericStructureWithEnumValueView< +[[nodiscard]] inline GenericStructureWithEnumValueView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5355,7 +5103,7 @@ MakeStructureWithEnumValueView( T &&emboss_reserved_local_arg) { } template -inline GenericStructureWithEnumValueView> +[[nodiscard]] inline GenericStructureWithEnumValueView> MakeStructureWithEnumValueView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericStructureWithEnumValueView>( @@ -5364,7 +5112,7 @@ MakeStructureWithEnumValueView( T *emboss_reserved_local_data, } template -inline GenericStructureWithEnumValueView< +[[nodiscard]] inline GenericStructureWithEnumValueView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructureWithEnumValueView( T *emboss_reserved_local_data, @@ -5431,72 +5179,42 @@ class GenericStructureWithBitsWithValueView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !alias_of_b_sum().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !alias_of_b_a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!b().Ok()) return false; + if (!alias_of_b_sum().Ok()) return false; + if (!alias_of_b_a().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericStructureWithBitsWithValueView emboss_reserved_local_other) const { if (!has_b().Known()) return false; @@ -5517,7 +5235,7 @@ class GenericStructureWithBitsWithValueView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericStructureWithBitsWithValueView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_b().ValueOr(false) && @@ -5550,7 +5268,7 @@ class GenericStructureWithBitsWithValueView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericStructureWithBitsWithValueView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -5702,13 +5420,13 @@ class GenericStructureWithBitsWithValueView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::test::GenericBitsWithValueView>, 32>> + [[nodiscard]] typename ::emboss::test::GenericBitsWithValueView>, 32>> b() const; - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: class EmbossReservedVirtualAliasOfBSumView final { @@ -5727,17 +5445,17 @@ class GenericStructureWithBitsWithValueView final { default; ~EmbossReservedVirtualAliasOfBSumView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_alias_of_b_sum().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -5750,19 +5468,19 @@ class GenericStructureWithBitsWithValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.b().sum(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); return emboss_reserved_local_subexpr_2; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -5770,15 +5488,15 @@ class GenericStructureWithBitsWithValueView final { const GenericStructureWithBitsWithValueView view_; }; - EmbossReservedVirtualAliasOfBSumView alias_of_b_sum() const; - ::emboss::support::Maybe has_alias_of_b_sum() const; + [[nodiscard]] EmbossReservedVirtualAliasOfBSumView alias_of_b_sum() const; + [[nodiscard]] ::emboss::support::Maybe has_alias_of_b_sum() const; public: - auto alias_of_b_a() const -> decltype(this->b().a()) { + [[nodiscard]] auto alias_of_b_a() const -> decltype(this->b().a()) { return has_alias_of_b_a().ValueOrDefault() ? b().a() : decltype(this->b().a())(); } - ::emboss::support::Maybe has_alias_of_b_a() const; + [[nodiscard]] ::emboss::support::Maybe has_alias_of_b_a() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -5794,9 +5512,9 @@ class GenericStructureWithBitsWithValueView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5805,13 +5523,13 @@ class GenericStructureWithBitsWithValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5829,9 +5547,9 @@ class GenericStructureWithBitsWithValueView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5840,13 +5558,13 @@ class GenericStructureWithBitsWithValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5864,9 +5582,9 @@ class GenericStructureWithBitsWithValueView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -5875,13 +5593,13 @@ class GenericStructureWithBitsWithValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -5912,7 +5630,7 @@ struct EmbossReservedInternalIsGenericStructureWithBitsWithValueView< }; template -inline GenericStructureWithBitsWithValueView< +[[nodiscard]] inline GenericStructureWithBitsWithValueView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5927,7 +5645,7 @@ MakeStructureWithBitsWithValueView( T &&emboss_reserved_local_arg) { } template -inline GenericStructureWithBitsWithValueView> +[[nodiscard]] inline GenericStructureWithBitsWithValueView> MakeStructureWithBitsWithValueView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericStructureWithBitsWithValueView>( @@ -5936,7 +5654,7 @@ MakeStructureWithBitsWithValueView( T *emboss_reserved_local_data, } template -inline GenericStructureWithBitsWithValueView< +[[nodiscard]] inline GenericStructureWithBitsWithValueView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructureWithBitsWithValueView( T *emboss_reserved_local_data, @@ -6003,72 +5721,42 @@ class GenericBitsWithValueView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !sum().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a().Ok()) return false; + if (!b().Ok()) return false; + if (!sum().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericBitsWithValueView emboss_reserved_local_other) const { if (!has_a().Known()) return false; @@ -6106,7 +5794,7 @@ class GenericBitsWithValueView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericBitsWithValueView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_a().ValueOr(false) && @@ -6153,7 +5841,7 @@ class GenericBitsWithValueView final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericBitsWithValueView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -6305,23 +5993,23 @@ class GenericBitsWithValueView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<16, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> a() const; - ::emboss::support::Maybe has_a() const; + [[nodiscard]] ::emboss::support::Maybe has_a() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<16, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> b() const; - ::emboss::support::Maybe has_b() const; + [[nodiscard]] ::emboss::support::Maybe has_b() const; public: class EmbossReservedVirtualSumView final { @@ -6340,17 +6028,17 @@ class GenericBitsWithValueView final { default; ~EmbossReservedVirtualSumView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_sum().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -6363,12 +6051,12 @@ class GenericBitsWithValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.a(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = view_.b(); @@ -6378,7 +6066,7 @@ class GenericBitsWithValueView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -6386,8 +6074,8 @@ class GenericBitsWithValueView final { const GenericBitsWithValueView view_; }; - EmbossReservedVirtualSumView sum() const; - ::emboss::support::Maybe has_sum() const; + [[nodiscard]] EmbossReservedVirtualSumView sum() const; + [[nodiscard]] ::emboss::support::Maybe has_sum() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -6403,9 +6091,9 @@ class GenericBitsWithValueView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6414,13 +6102,13 @@ class GenericBitsWithValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -6438,9 +6126,9 @@ class GenericBitsWithValueView final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6449,13 +6137,13 @@ class GenericBitsWithValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -6473,9 +6161,9 @@ class GenericBitsWithValueView final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6484,13 +6172,13 @@ class GenericBitsWithValueView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -6521,7 +6209,7 @@ struct EmbossReservedInternalIsGenericBitsWithValueView< }; template -inline GenericBitsWithValueView< +[[nodiscard]] inline GenericBitsWithValueView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -6536,7 +6224,7 @@ MakeBitsWithValueView( T &&emboss_reserved_local_arg) { } template -inline GenericBitsWithValueView> +[[nodiscard]] inline GenericBitsWithValueView> MakeBitsWithValueView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericBitsWithValueView>( @@ -6545,7 +6233,7 @@ MakeBitsWithValueView( T *emboss_reserved_local_data, } template -inline GenericBitsWithValueView< +[[nodiscard]] inline GenericBitsWithValueView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedBitsWithValueView( T *emboss_reserved_local_data, @@ -6611,65 +6299,41 @@ class GenericStructureUsingForeignConstantsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !one_hundred().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!one_hundred().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericStructureUsingForeignConstantsView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -6690,7 +6354,7 @@ class GenericStructureUsingForeignConstantsView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericStructureUsingForeignConstantsView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -6723,7 +6387,7 @@ class GenericStructureUsingForeignConstantsView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericStructureUsingForeignConstantsView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -6837,15 +6501,15 @@ class GenericStructureUsingForeignConstantsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<32, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 32>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: class EmbossReservedVirtualOneHundredView final { @@ -6861,9 +6525,9 @@ class GenericStructureUsingForeignConstantsView final { default; ~EmbossReservedVirtualOneHundredView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6872,13 +6536,13 @@ class GenericStructureUsingForeignConstantsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedVirtualOneHundredView one_hundred() { + [[nodiscard]] static constexpr EmbossReservedVirtualOneHundredView one_hundred() { return EmbossReservedVirtualOneHundredView(); } - static constexpr ::emboss::support::Maybe has_one_hundred() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_one_hundred() { return ::emboss::support::Maybe(true); } @@ -6896,9 +6560,9 @@ class GenericStructureUsingForeignConstantsView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6907,13 +6571,13 @@ class GenericStructureUsingForeignConstantsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -6931,9 +6595,9 @@ class GenericStructureUsingForeignConstantsView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6942,13 +6606,13 @@ class GenericStructureUsingForeignConstantsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -6966,9 +6630,9 @@ class GenericStructureUsingForeignConstantsView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -6977,13 +6641,13 @@ class GenericStructureUsingForeignConstantsView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -7014,7 +6678,7 @@ struct EmbossReservedInternalIsGenericStructureUsingForeignConstantsView< }; template -inline GenericStructureUsingForeignConstantsView< +[[nodiscard]] inline GenericStructureUsingForeignConstantsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -7029,7 +6693,7 @@ MakeStructureUsingForeignConstantsView( T &&emboss_reserved_local_arg) { } template -inline GenericStructureUsingForeignConstantsView> +[[nodiscard]] inline GenericStructureUsingForeignConstantsView> MakeStructureUsingForeignConstantsView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericStructureUsingForeignConstantsView>( @@ -7038,7 +6702,7 @@ MakeStructureUsingForeignConstantsView( T *emboss_reserved_local_data, } template -inline GenericStructureUsingForeignConstantsView< +[[nodiscard]] inline GenericStructureUsingForeignConstantsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructureUsingForeignConstantsView( T *emboss_reserved_local_data, @@ -7110,65 +6774,41 @@ class GenericHeaderView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !size().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !message_id().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!size().Ok()) return false; + if (!message_id().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericHeaderView emboss_reserved_local_other) const { if (!has_size().Known()) return false; @@ -7206,7 +6846,7 @@ class GenericHeaderView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericHeaderView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_size().ValueOr(false) && @@ -7253,7 +6893,7 @@ class GenericHeaderView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericHeaderView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -7386,23 +7026,23 @@ class GenericHeaderView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<16, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 16>> size() const; - ::emboss::support::Maybe has_size() const; + [[nodiscard]] ::emboss::support::Maybe has_size() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<16, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 16>> message_id() const; - ::emboss::support::Maybe has_message_id() const; + [[nodiscard]] ::emboss::support::Maybe has_message_id() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -7418,9 +7058,9 @@ class GenericHeaderView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -7429,13 +7069,13 @@ class GenericHeaderView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -7453,9 +7093,9 @@ class GenericHeaderView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -7464,13 +7104,13 @@ class GenericHeaderView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -7488,9 +7128,9 @@ class GenericHeaderView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -7499,13 +7139,13 @@ class GenericHeaderView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -7536,7 +7176,7 @@ struct EmbossReservedInternalIsGenericHeaderView< }; template -inline GenericHeaderView< +[[nodiscard]] inline GenericHeaderView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -7551,7 +7191,7 @@ MakeHeaderView( T &&emboss_reserved_local_arg) { } template -inline GenericHeaderView> +[[nodiscard]] inline GenericHeaderView> MakeHeaderView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericHeaderView>( @@ -7560,7 +7200,7 @@ MakeHeaderView( T *emboss_reserved_local_data, } template -inline GenericHeaderView< +[[nodiscard]] inline GenericHeaderView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedHeaderView( T *emboss_reserved_local_data, @@ -7621,72 +7261,42 @@ class GenericSubfieldOfAliasView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !header().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !h().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !size().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!header().Ok()) return false; + if (!h().Ok()) return false; + if (!size().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericSubfieldOfAliasView emboss_reserved_local_other) const { if (!has_header().Known()) return false; @@ -7707,7 +7317,7 @@ class GenericSubfieldOfAliasView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericSubfieldOfAliasView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_header().ValueOr(false) && @@ -7740,7 +7350,7 @@ class GenericSubfieldOfAliasView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericSubfieldOfAliasView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -7911,27 +7521,27 @@ class GenericSubfieldOfAliasView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::test::SubfieldOfAlias::GenericHeaderView> + [[nodiscard]] typename ::emboss::test::SubfieldOfAlias::GenericHeaderView> header() const; - ::emboss::support::Maybe has_header() const; + [[nodiscard]] ::emboss::support::Maybe has_header() const; public: - auto h() const -> decltype(this->header()) { + [[nodiscard]] auto h() const -> decltype(this->header()) { return has_h().ValueOrDefault() ? header() : decltype(this->header())(); } - ::emboss::support::Maybe has_h() const; + [[nodiscard]] ::emboss::support::Maybe has_h() const; public: - auto size() const -> decltype(this->h().size()) { + [[nodiscard]] auto size() const -> decltype(this->h().size()) { return has_size().ValueOrDefault() ? h().size() : decltype(this->h().size())(); } - ::emboss::support::Maybe has_size() const; + [[nodiscard]] ::emboss::support::Maybe has_size() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -7947,9 +7557,9 @@ class GenericSubfieldOfAliasView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -7958,13 +7568,13 @@ class GenericSubfieldOfAliasView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -7982,9 +7592,9 @@ class GenericSubfieldOfAliasView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -7993,13 +7603,13 @@ class GenericSubfieldOfAliasView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -8017,9 +7627,9 @@ class GenericSubfieldOfAliasView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -8028,13 +7638,13 @@ class GenericSubfieldOfAliasView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -8065,7 +7675,7 @@ struct EmbossReservedInternalIsGenericSubfieldOfAliasView< }; template -inline GenericSubfieldOfAliasView< +[[nodiscard]] inline GenericSubfieldOfAliasView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -8080,7 +7690,7 @@ MakeSubfieldOfAliasView( T &&emboss_reserved_local_arg) { } template -inline GenericSubfieldOfAliasView> +[[nodiscard]] inline GenericSubfieldOfAliasView> MakeSubfieldOfAliasView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericSubfieldOfAliasView>( @@ -8089,7 +7699,7 @@ MakeSubfieldOfAliasView( T *emboss_reserved_local_data, } template -inline GenericSubfieldOfAliasView< +[[nodiscard]] inline GenericSubfieldOfAliasView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedSubfieldOfAliasView( T *emboss_reserved_local_data, @@ -8156,72 +7766,51 @@ class GenericRestrictedAliasView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = alias_switch(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::GreaterThan(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(10LL))); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a_b().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !alias_switch().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThan((alias_switch().Ok() ? ::emboss::support::Maybe(static_cast(alias_switch().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(10LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !a_b_alias().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a_b().Ok()) return false; + if (!alias_switch().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_3; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!a_b_alias().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericRestrictedAliasView emboss_reserved_local_other) const { if (!has_a_b().Known()) return false; @@ -8259,7 +7848,7 @@ class GenericRestrictedAliasView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericRestrictedAliasView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_a_b().ValueOr(false) && @@ -8306,7 +7895,7 @@ class GenericRestrictedAliasView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericRestrictedAliasView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -8477,28 +8066,28 @@ class GenericRestrictedAliasView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::test::GenericBitsWithValueView>, 32>> + [[nodiscard]] typename ::emboss::test::GenericBitsWithValueView>, 32>> a_b() const; - ::emboss::support::Maybe has_a_b() const; + [[nodiscard]] ::emboss::support::Maybe has_a_b() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> alias_switch() const; - ::emboss::support::Maybe has_alias_switch() const; + [[nodiscard]] ::emboss::support::Maybe has_alias_switch() const; public: - auto a_b_alias() const -> decltype(this->a_b()) { + [[nodiscard]] auto a_b_alias() const -> decltype(this->a_b()) { return has_a_b_alias().ValueOrDefault() ? a_b() : decltype(this->a_b())(); } - ::emboss::support::Maybe has_a_b_alias() const; + [[nodiscard]] ::emboss::support::Maybe has_a_b_alias() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -8514,9 +8103,9 @@ class GenericRestrictedAliasView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -8525,13 +8114,13 @@ class GenericRestrictedAliasView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -8549,9 +8138,9 @@ class GenericRestrictedAliasView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -8560,13 +8149,13 @@ class GenericRestrictedAliasView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -8584,9 +8173,9 @@ class GenericRestrictedAliasView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -8595,13 +8184,13 @@ class GenericRestrictedAliasView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -8632,7 +8221,7 @@ struct EmbossReservedInternalIsGenericRestrictedAliasView< }; template -inline GenericRestrictedAliasView< +[[nodiscard]] inline GenericRestrictedAliasView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -8647,7 +8236,7 @@ MakeRestrictedAliasView( T &&emboss_reserved_local_arg) { } template -inline GenericRestrictedAliasView> +[[nodiscard]] inline GenericRestrictedAliasView> MakeRestrictedAliasView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericRestrictedAliasView>( @@ -8656,7 +8245,7 @@ MakeRestrictedAliasView( T *emboss_reserved_local_data, } template -inline GenericRestrictedAliasView< +[[nodiscard]] inline GenericRestrictedAliasView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedRestrictedAliasView( T *emboss_reserved_local_data, @@ -8729,64 +8318,49 @@ class GenericXView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = v(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::GreaterThan(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(10LL))); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !v().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThan((v().Ok() ? ::emboss::support::Maybe(static_cast(v().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(10LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!v().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_3; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!y().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericXView emboss_reserved_local_other) const { if (!has_v().Known()) return false; @@ -8824,7 +8398,7 @@ class GenericXView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericXView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_v().ValueOr(false) && @@ -8871,7 +8445,7 @@ class GenericXView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericXView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -9004,23 +8578,23 @@ class GenericXView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> v() const; - ::emboss::support::Maybe has_v() const; + [[nodiscard]] ::emboss::support::Maybe has_v() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> y() const; - ::emboss::support::Maybe has_y() const; + [[nodiscard]] ::emboss::support::Maybe has_y() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -9039,17 +8613,17 @@ class GenericXView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -9062,12 +8636,12 @@ class GenericXView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.v(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::GreaterThan(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(10LL))); @@ -9077,7 +8651,7 @@ class GenericXView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -9085,8 +8659,8 @@ class GenericXView final { const GenericXView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -9102,9 +8676,9 @@ class GenericXView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -9113,13 +8687,13 @@ class GenericXView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -9137,9 +8711,9 @@ class GenericXView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -9148,13 +8722,13 @@ class GenericXView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -9185,7 +8759,7 @@ struct EmbossReservedInternalIsGenericXView< }; template -inline GenericXView< +[[nodiscard]] inline GenericXView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -9200,7 +8774,7 @@ MakeXView( T &&emboss_reserved_local_arg) { } template -inline GenericXView> +[[nodiscard]] inline GenericXView> MakeXView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericXView>( @@ -9209,7 +8783,7 @@ MakeXView( T *emboss_reserved_local_data, } template -inline GenericXView< +[[nodiscard]] inline GenericXView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedXView( T *emboss_reserved_local_data, @@ -9270,78 +8844,65 @@ class GenericHasFieldView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = z(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); + const auto emboss_reserved_local_ok_subexpr_3 = ::emboss::support::GreaterThan(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(10LL))); + const auto emboss_reserved_local_ok_subexpr_4 = x().has_y(); + const auto emboss_reserved_local_ok_subexpr_5 = has_x(); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !z().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::GreaterThan((z().Ok() ? ::emboss::support::Maybe(static_cast(z().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(10LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = x().has_y(); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = has_x(); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x_has_y().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!z().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_3; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_4; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!y().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = emboss_reserved_local_ok_subexpr_5; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x_has_y().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericHasFieldView emboss_reserved_local_other) const { if (!has_z().Known()) return false; @@ -9379,7 +8940,7 @@ class GenericHasFieldView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericHasFieldView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_z().ValueOr(false) && @@ -9426,7 +8987,7 @@ class GenericHasFieldView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericHasFieldView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -9616,28 +9177,28 @@ class GenericHasFieldView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> z() const; - ::emboss::support::Maybe has_z() const; + [[nodiscard]] ::emboss::support::Maybe has_z() const; public: - typename ::emboss::test::HasField::GenericXView> + [[nodiscard]] typename ::emboss::test::HasField::GenericXView> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - auto y() const -> decltype(this->x().y()) { + [[nodiscard]] auto y() const -> decltype(this->x().y()) { return has_y().ValueOrDefault() ? x().y() : decltype(this->x().y())(); } - ::emboss::support::Maybe has_y() const; + [[nodiscard]] ::emboss::support::Maybe has_y() const; public: class EmbossReservedVirtualXHasYView final { @@ -9656,17 +9217,17 @@ class GenericHasFieldView final { default; ~EmbossReservedVirtualXHasYView() = default; - bool Read() const { + [[nodiscard]] bool Read() const { EMBOSS_CHECK(view_.has_x_has_y().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - bool UncheckedRead() const { + [[nodiscard]] bool UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -9679,18 +9240,18 @@ class GenericHasFieldView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x().has_y(); return emboss_reserved_local_subexpr_1; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( bool emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -9698,8 +9259,8 @@ class GenericHasFieldView final { const GenericHasFieldView view_; }; - EmbossReservedVirtualXHasYView x_has_y() const; - ::emboss::support::Maybe has_x_has_y() const; + [[nodiscard]] EmbossReservedVirtualXHasYView x_has_y() const; + [[nodiscard]] ::emboss::support::Maybe has_x_has_y() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -9718,17 +9279,17 @@ class GenericHasFieldView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -9741,12 +9302,12 @@ class GenericHasFieldView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.z(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::GreaterThan(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(10LL))); @@ -9756,7 +9317,7 @@ class GenericHasFieldView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -9764,8 +9325,8 @@ class GenericHasFieldView final { const GenericHasFieldView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -9781,9 +9342,9 @@ class GenericHasFieldView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -9792,13 +9353,13 @@ class GenericHasFieldView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -9816,9 +9377,9 @@ class GenericHasFieldView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -9827,13 +9388,13 @@ class GenericHasFieldView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -9864,7 +9425,7 @@ struct EmbossReservedInternalIsGenericHasFieldView< }; template -inline GenericHasFieldView< +[[nodiscard]] inline GenericHasFieldView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -9879,7 +9440,7 @@ MakeHasFieldView( T &&emboss_reserved_local_arg) { } template -inline GenericHasFieldView> +[[nodiscard]] inline GenericHasFieldView> MakeHasFieldView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericHasFieldView>( @@ -9888,7 +9449,7 @@ MakeHasFieldView( T *emboss_reserved_local_data, } template -inline GenericHasFieldView< +[[nodiscard]] inline GenericHasFieldView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedHasFieldView( T *emboss_reserved_local_data, @@ -9955,71 +9516,51 @@ class GenericVirtualUnconditionallyUsesConditionalView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; + const auto emboss_reserved_local_ok_subexpr_1 = x(); + const auto emboss_reserved_local_ok_subexpr_2 = (emboss_reserved_local_ok_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_ok_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Equal((x().Ok() ? ::emboss::support::Maybe(static_cast(x().UncheckedRead())) : ::emboss::support::Maybe()), ::emboss::support::Maybe(static_cast(0LL))); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x_nor_xc().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!x_nor_xc().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_switch_discrim = emboss_reserved_local_ok_subexpr_2; + if (!emboss_reserved_switch_discrim.Known()) return false; + switch (emboss_reserved_switch_discrim.ValueOrDefault()) { + case static_cast(0LL): + if (!xc().Ok()) return false; + break; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - ::std::size_t SizeInBytes() const { + [[nodiscard]] ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); } - bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } + [[nodiscard]] bool SizeIsKnown() const { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericVirtualUnconditionallyUsesConditionalView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -10057,7 +9598,7 @@ class GenericVirtualUnconditionallyUsesConditionalView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericVirtualUnconditionallyUsesConditionalView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -10104,7 +9645,7 @@ class GenericVirtualUnconditionallyUsesConditionalView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericVirtualUnconditionallyUsesConditionalView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -10256,23 +9797,23 @@ class GenericVirtualUnconditionallyUsesConditionalView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> xc() const; - ::emboss::support::Maybe has_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_xc() const; public: class EmbossReservedVirtualXNorXcView final { @@ -10291,17 +9832,17 @@ class GenericVirtualUnconditionallyUsesConditionalView final { default; ~EmbossReservedVirtualXNorXcView() = default; - bool Read() const { + [[nodiscard]] bool Read() const { EMBOSS_CHECK(view_.has_x_nor_xc().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - bool UncheckedRead() const { + [[nodiscard]] bool UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -10314,12 +9855,12 @@ class GenericVirtualUnconditionallyUsesConditionalView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(0LL))); @@ -10331,7 +9872,7 @@ class GenericVirtualUnconditionallyUsesConditionalView final { return emboss_reserved_local_subexpr_7; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( bool emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -10339,8 +9880,8 @@ class GenericVirtualUnconditionallyUsesConditionalView final { const GenericVirtualUnconditionallyUsesConditionalView view_; }; - EmbossReservedVirtualXNorXcView x_nor_xc() const; - ::emboss::support::Maybe has_x_nor_xc() const; + [[nodiscard]] EmbossReservedVirtualXNorXcView x_nor_xc() const; + [[nodiscard]] ::emboss::support::Maybe has_x_nor_xc() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -10359,17 +9900,17 @@ class GenericVirtualUnconditionallyUsesConditionalView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_IntrinsicSizeInBytes().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -10382,12 +9923,12 @@ class GenericVirtualUnconditionallyUsesConditionalView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Equal(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(0LL))); @@ -10397,7 +9938,7 @@ class GenericVirtualUnconditionallyUsesConditionalView final { return emboss_reserved_local_subexpr_5; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -10405,8 +9946,8 @@ class GenericVirtualUnconditionallyUsesConditionalView final { const GenericVirtualUnconditionallyUsesConditionalView view_; }; - EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; - ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; + [[nodiscard]] EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() const; + [[nodiscard]] ::emboss::support::Maybe has_IntrinsicSizeInBytes() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -10422,9 +9963,9 @@ class GenericVirtualUnconditionallyUsesConditionalView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -10433,13 +9974,13 @@ class GenericVirtualUnconditionallyUsesConditionalView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -10457,9 +9998,9 @@ class GenericVirtualUnconditionallyUsesConditionalView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -10468,13 +10009,13 @@ class GenericVirtualUnconditionallyUsesConditionalView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -10505,7 +10046,7 @@ struct EmbossReservedInternalIsGenericVirtualUnconditionallyUsesConditionalView< }; template -inline GenericVirtualUnconditionallyUsesConditionalView< +[[nodiscard]] inline GenericVirtualUnconditionallyUsesConditionalView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -10520,7 +10061,7 @@ MakeVirtualUnconditionallyUsesConditionalView( T &&emboss_reserved_local_arg) { } template -inline GenericVirtualUnconditionallyUsesConditionalView> +[[nodiscard]] inline GenericVirtualUnconditionallyUsesConditionalView> MakeVirtualUnconditionallyUsesConditionalView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericVirtualUnconditionallyUsesConditionalView>( @@ -10529,7 +10070,7 @@ MakeVirtualUnconditionallyUsesConditionalView( T *emboss_reserved_local_data, } template -inline GenericVirtualUnconditionallyUsesConditionalView< +[[nodiscard]] inline GenericVirtualUnconditionallyUsesConditionalView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedVirtualUnconditionallyUsesConditionalView( T *emboss_reserved_local_data, @@ -10600,65 +10141,41 @@ class GenericRView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !q().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !q_plus_bit_size().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBits().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!q().Ok()) return false; + if (!IntrinsicSizeInBits().Ok()) return false; + if (!q_plus_bit_size().Ok()) return false; + if (!MaxSizeInBits().Ok()) return false; + if (!MinSizeInBits().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBits().Ok() && backing_.SizeInBits() >= static_cast( IntrinsicSizeInBits().UncheckedRead()); } - static constexpr ::std::size_t SizeInBits() { + [[nodiscard]] static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBits().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericRView emboss_reserved_local_other) const { if (!has_q().Known()) return false; @@ -10679,7 +10196,7 @@ class GenericRView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericRView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_q().ValueOr(false) && @@ -10712,7 +10229,7 @@ class GenericRView final { emboss_reserved_local_other.IntrinsicSizeInBits().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericRView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -10826,15 +10343,15 @@ class GenericRView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename Storage::template OffsetStorageType> q() const; - ::emboss::support::Maybe has_q() const; + [[nodiscard]] ::emboss::support::Maybe has_q() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBitsView final { @@ -10850,9 +10367,9 @@ class GenericRView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -10861,13 +10378,13 @@ class GenericRView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBitsView IntrinsicSizeInBits() { return EmbossReservedDollarVirtualIntrinsicSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBits() { return ::emboss::support::Maybe(true); } @@ -10888,17 +10405,17 @@ class GenericRView final { default; ~EmbossReservedVirtualQPlusBitSizeView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_q_plus_bit_size().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -10911,12 +10428,12 @@ class GenericRView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.q(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(8LL))); @@ -10924,7 +10441,7 @@ class GenericRView final { return emboss_reserved_local_subexpr_3; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -10932,8 +10449,8 @@ class GenericRView final { const GenericRView view_; }; - EmbossReservedVirtualQPlusBitSizeView q_plus_bit_size() const; - ::emboss::support::Maybe has_q_plus_bit_size() const; + [[nodiscard]] EmbossReservedVirtualQPlusBitSizeView q_plus_bit_size() const; + [[nodiscard]] ::emboss::support::Maybe has_q_plus_bit_size() const; public: class EmbossReservedDollarVirtualMaxSizeInBitsView final { @@ -10949,9 +10466,9 @@ class GenericRView final { default; ~EmbossReservedDollarVirtualMaxSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -10960,13 +10477,13 @@ class GenericRView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBitsView MaxSizeInBits() { return EmbossReservedDollarVirtualMaxSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBits() { return ::emboss::support::Maybe(true); } @@ -10984,9 +10501,9 @@ class GenericRView final { default; ~EmbossReservedDollarVirtualMinSizeInBitsView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -10995,13 +10512,13 @@ class GenericRView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBitsView MinSizeInBits() { return EmbossReservedDollarVirtualMinSizeInBitsView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBits() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBits() { return ::emboss::support::Maybe(true); } @@ -11032,7 +10549,7 @@ struct EmbossReservedInternalIsGenericRView< }; template -inline GenericRView< +[[nodiscard]] inline GenericRView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -11047,7 +10564,7 @@ MakeRView( T &&emboss_reserved_local_arg) { } template -inline GenericRView> +[[nodiscard]] inline GenericRView> MakeRView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericRView>( @@ -11056,7 +10573,7 @@ MakeRView( T *emboss_reserved_local_data, } template -inline GenericRView< +[[nodiscard]] inline GenericRView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedRView( T *emboss_reserved_local_data, @@ -11117,65 +10634,41 @@ class GenericUsesSizeView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !r().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !r_q_plus_byte_size().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!r().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!r_q_plus_byte_size().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericUsesSizeView emboss_reserved_local_other) const { if (!has_r().Known()) return false; @@ -11196,7 +10689,7 @@ class GenericUsesSizeView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericUsesSizeView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_r().ValueOr(false) && @@ -11229,7 +10722,7 @@ class GenericUsesSizeView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericUsesSizeView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -11343,13 +10836,13 @@ class GenericUsesSizeView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::test::UsesSize::GenericRView>, 8>> + [[nodiscard]] typename ::emboss::test::UsesSize::GenericRView>, 8>> r() const; - ::emboss::support::Maybe has_r() const; + [[nodiscard]] ::emboss::support::Maybe has_r() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -11365,9 +10858,9 @@ class GenericUsesSizeView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -11376,13 +10869,13 @@ class GenericUsesSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -11403,17 +10896,17 @@ class GenericUsesSizeView final { default; ~EmbossReservedVirtualRQPlusByteSizeView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_r_q_plus_byte_size().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -11426,12 +10919,12 @@ class GenericUsesSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.r().q(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(1LL))); @@ -11439,7 +10932,7 @@ class GenericUsesSizeView final { return emboss_reserved_local_subexpr_3; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -11447,8 +10940,8 @@ class GenericUsesSizeView final { const GenericUsesSizeView view_; }; - EmbossReservedVirtualRQPlusByteSizeView r_q_plus_byte_size() const; - ::emboss::support::Maybe has_r_q_plus_byte_size() const; + [[nodiscard]] EmbossReservedVirtualRQPlusByteSizeView r_q_plus_byte_size() const; + [[nodiscard]] ::emboss::support::Maybe has_r_q_plus_byte_size() const; public: class EmbossReservedDollarVirtualMaxSizeInBytesView final { @@ -11464,9 +10957,9 @@ class GenericUsesSizeView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -11475,13 +10968,13 @@ class GenericUsesSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -11499,9 +10992,9 @@ class GenericUsesSizeView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -11510,13 +11003,13 @@ class GenericUsesSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -11547,7 +11040,7 @@ struct EmbossReservedInternalIsGenericUsesSizeView< }; template -inline GenericUsesSizeView< +[[nodiscard]] inline GenericUsesSizeView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -11562,7 +11055,7 @@ MakeUsesSizeView( T &&emboss_reserved_local_arg) { } template -inline GenericUsesSizeView> +[[nodiscard]] inline GenericUsesSizeView> MakeUsesSizeView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericUsesSizeView>( @@ -11571,7 +11064,7 @@ MakeUsesSizeView( T *emboss_reserved_local_data, } template -inline GenericUsesSizeView< +[[nodiscard]] inline GenericUsesSizeView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedUsesSizeView( T *emboss_reserved_local_data, @@ -11637,65 +11130,41 @@ class GenericUsesExternalSizeView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !y().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!y().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericUsesExternalSizeView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -11733,7 +11202,7 @@ class GenericUsesExternalSizeView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericUsesExternalSizeView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -11780,7 +11249,7 @@ class GenericUsesExternalSizeView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericUsesExternalSizeView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -11913,19 +11382,19 @@ class GenericUsesExternalSizeView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::test::GenericStructureWithConstantsView> + [[nodiscard]] typename ::emboss::test::GenericStructureWithConstantsView> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: - typename ::emboss::test::GenericStructureWithConstantsView> + [[nodiscard]] typename ::emboss::test::GenericStructureWithConstantsView> y() const; - ::emboss::support::Maybe has_y() const; + [[nodiscard]] ::emboss::support::Maybe has_y() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -11941,9 +11410,9 @@ class GenericUsesExternalSizeView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -11952,13 +11421,13 @@ class GenericUsesExternalSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -11976,9 +11445,9 @@ class GenericUsesExternalSizeView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -11987,13 +11456,13 @@ class GenericUsesExternalSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -12011,9 +11480,9 @@ class GenericUsesExternalSizeView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -12022,13 +11491,13 @@ class GenericUsesExternalSizeView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -12059,7 +11528,7 @@ struct EmbossReservedInternalIsGenericUsesExternalSizeView< }; template -inline GenericUsesExternalSizeView< +[[nodiscard]] inline GenericUsesExternalSizeView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -12074,7 +11543,7 @@ MakeUsesExternalSizeView( T &&emboss_reserved_local_arg) { } template -inline GenericUsesExternalSizeView> +[[nodiscard]] inline GenericUsesExternalSizeView> MakeUsesExternalSizeView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericUsesExternalSizeView>( @@ -12083,7 +11552,7 @@ MakeUsesExternalSizeView( T *emboss_reserved_local_data, } template -inline GenericUsesExternalSizeView< +[[nodiscard]] inline GenericUsesExternalSizeView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedUsesExternalSizeView( T *emboss_reserved_local_data, @@ -12153,93 +11622,45 @@ class GenericImplicitWriteBackView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x_plus_ten().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !ten_plus_x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !x_minus_ten().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !ten_minus_x().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !ten_minus_x_plus_ten().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - } - - - { - const auto emboss_reserved_local_field_present = ::emboss::support::Maybe(true); - if (!emboss_reserved_local_field_present.Known()) return false; - if (emboss_reserved_local_field_present.ValueOrDefault() && !MinSizeInBytes().Ok()) return false; + const auto emboss_reserved_cond = ::emboss::support::Maybe(true); + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!x().Ok()) return false; + if (!x_plus_ten().Ok()) return false; + if (!ten_plus_x().Ok()) return false; + if (!x_minus_ten().Ok()) return false; + if (!ten_minus_x().Ok()) return false; + if (!ten_minus_x_plus_ten().Ok()) return false; + if (!IntrinsicSizeInBytes().Ok()) return false; + if (!MaxSizeInBytes().Ok()) return false; + if (!MinSizeInBytes().Ok()) return false; + } } - - return true; } - Storage BackingStorage() const { return backing_; } - bool IsComplete() const { + [[nodiscard]] Storage BackingStorage() const { return backing_; } + [[nodiscard]] bool IsComplete() const { return backing_.Ok() && IntrinsicSizeInBytes().Ok() && backing_.SizeInBytes() >= static_cast( IntrinsicSizeInBytes().UncheckedRead()); } - static constexpr ::std::size_t SizeInBytes() { + [[nodiscard]] static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); } - static constexpr bool SizeIsKnown() { + [[nodiscard]] static constexpr bool SizeIsKnown() { return IntrinsicSizeInBytes().Ok(); } template - bool Equals( + [[nodiscard]] bool Equals( GenericImplicitWriteBackView emboss_reserved_local_other) const { if (!has_x().Known()) return false; @@ -12260,7 +11681,7 @@ class GenericImplicitWriteBackView final { return true; } template - bool UncheckedEquals( + [[nodiscard]] bool UncheckedEquals( GenericImplicitWriteBackView emboss_reserved_local_other) const { if (emboss_reserved_local_other.has_x().ValueOr(false) && @@ -12293,7 +11714,7 @@ class GenericImplicitWriteBackView final { emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); } template - bool TryToCopyFrom( + [[nodiscard]] bool TryToCopyFrom( GenericImplicitWriteBackView emboss_reserved_local_other) const { return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( emboss_reserved_local_other.BackingStorage(), @@ -12578,15 +11999,15 @@ class GenericImplicitWriteBackView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: - typename ::emboss::prelude::UIntView< + [[nodiscard]] typename ::emboss::prelude::UIntView< /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, typename ::emboss::support::BitBlock>, 8>> x() const; - ::emboss::support::Maybe has_x() const; + [[nodiscard]] ::emboss::support::Maybe has_x() const; public: class EmbossReservedVirtualXPlusTenView final { @@ -12605,17 +12026,17 @@ class GenericImplicitWriteBackView final { default; ~EmbossReservedVirtualXPlusTenView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_x_plus_ten().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -12628,9 +12049,9 @@ class GenericImplicitWriteBackView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } - bool TryToWrite(::std::int32_t emboss_reserved_local_value) { + [[nodiscard]] bool TryToWrite(::std::int32_t emboss_reserved_local_value) { const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(10LL))); if (!CouldWriteValue(emboss_reserved_local_value)) return false; return view_.x().TryToWrite( @@ -12644,7 +12065,7 @@ class GenericImplicitWriteBackView final { void UncheckedWrite(::std::int32_t emboss_reserved_local_value) { view_.x().UncheckedWrite((::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(10LL)))).ValueOrDefault()); } - bool CouldWriteValue(::std::int32_t emboss_reserved_local_value) { + [[nodiscard]] bool CouldWriteValue(::std::int32_t emboss_reserved_local_value) { if (!ValueIsOk(emboss_reserved_local_value)) return false; const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(10LL))); if (!emboss_reserved_local_maybe_new_value.Known()) return false; @@ -12660,7 +12081,7 @@ class GenericImplicitWriteBackView final { private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(10LL))); @@ -12668,7 +12089,7 @@ class GenericImplicitWriteBackView final { return emboss_reserved_local_subexpr_3; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -12676,8 +12097,8 @@ class GenericImplicitWriteBackView final { const GenericImplicitWriteBackView view_; }; - EmbossReservedVirtualXPlusTenView x_plus_ten() const; - ::emboss::support::Maybe has_x_plus_ten() const; + [[nodiscard]] EmbossReservedVirtualXPlusTenView x_plus_ten() const; + [[nodiscard]] ::emboss::support::Maybe has_x_plus_ten() const; public: class EmbossReservedVirtualTenPlusXView final { @@ -12696,17 +12117,17 @@ class GenericImplicitWriteBackView final { default; ~EmbossReservedVirtualTenPlusXView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_ten_plus_x().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -12719,9 +12140,9 @@ class GenericImplicitWriteBackView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } - bool TryToWrite(::std::int32_t emboss_reserved_local_value) { + [[nodiscard]] bool TryToWrite(::std::int32_t emboss_reserved_local_value) { const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(10LL))); if (!CouldWriteValue(emboss_reserved_local_value)) return false; return view_.x().TryToWrite( @@ -12735,7 +12156,7 @@ class GenericImplicitWriteBackView final { void UncheckedWrite(::std::int32_t emboss_reserved_local_value) { view_.x().UncheckedWrite((::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(10LL)))).ValueOrDefault()); } - bool CouldWriteValue(::std::int32_t emboss_reserved_local_value) { + [[nodiscard]] bool CouldWriteValue(::std::int32_t emboss_reserved_local_value) { if (!ValueIsOk(emboss_reserved_local_value)) return false; const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(10LL))); if (!emboss_reserved_local_maybe_new_value.Known()) return false; @@ -12751,7 +12172,7 @@ class GenericImplicitWriteBackView final { private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Sum(::emboss::support::Maybe(static_cast(10LL)), emboss_reserved_local_subexpr_2); @@ -12759,7 +12180,7 @@ class GenericImplicitWriteBackView final { return emboss_reserved_local_subexpr_3; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -12767,8 +12188,8 @@ class GenericImplicitWriteBackView final { const GenericImplicitWriteBackView view_; }; - EmbossReservedVirtualTenPlusXView ten_plus_x() const; - ::emboss::support::Maybe has_ten_plus_x() const; + [[nodiscard]] EmbossReservedVirtualTenPlusXView ten_plus_x() const; + [[nodiscard]] ::emboss::support::Maybe has_ten_plus_x() const; public: class EmbossReservedVirtualXMinusTenView final { @@ -12787,17 +12208,17 @@ class GenericImplicitWriteBackView final { default; ~EmbossReservedVirtualXMinusTenView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_x_minus_ten().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -12810,9 +12231,9 @@ class GenericImplicitWriteBackView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } - bool TryToWrite(::std::int32_t emboss_reserved_local_value) { + [[nodiscard]] bool TryToWrite(::std::int32_t emboss_reserved_local_value) { const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Sum(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(10LL))); if (!CouldWriteValue(emboss_reserved_local_value)) return false; return view_.x().TryToWrite( @@ -12826,7 +12247,7 @@ class GenericImplicitWriteBackView final { void UncheckedWrite(::std::int32_t emboss_reserved_local_value) { view_.x().UncheckedWrite((::emboss::support::Sum(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(10LL)))).ValueOrDefault()); } - bool CouldWriteValue(::std::int32_t emboss_reserved_local_value) { + [[nodiscard]] bool CouldWriteValue(::std::int32_t emboss_reserved_local_value) { if (!ValueIsOk(emboss_reserved_local_value)) return false; const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Sum(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(10LL))); if (!emboss_reserved_local_maybe_new_value.Known()) return false; @@ -12842,7 +12263,7 @@ class GenericImplicitWriteBackView final { private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Difference(emboss_reserved_local_subexpr_2, ::emboss::support::Maybe(static_cast(10LL))); @@ -12850,7 +12271,7 @@ class GenericImplicitWriteBackView final { return emboss_reserved_local_subexpr_3; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -12858,8 +12279,8 @@ class GenericImplicitWriteBackView final { const GenericImplicitWriteBackView view_; }; - EmbossReservedVirtualXMinusTenView x_minus_ten() const; - ::emboss::support::Maybe has_x_minus_ten() const; + [[nodiscard]] EmbossReservedVirtualXMinusTenView x_minus_ten() const; + [[nodiscard]] ::emboss::support::Maybe has_x_minus_ten() const; public: class EmbossReservedVirtualTenMinusXView final { @@ -12878,17 +12299,17 @@ class GenericImplicitWriteBackView final { default; ~EmbossReservedVirtualTenMinusXView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_ten_minus_x().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -12901,9 +12322,9 @@ class GenericImplicitWriteBackView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } - bool TryToWrite(::std::int32_t emboss_reserved_local_value) { + [[nodiscard]] bool TryToWrite(::std::int32_t emboss_reserved_local_value) { const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Difference(::emboss::support::Maybe(static_cast(10LL)), ::emboss::support::Maybe(emboss_reserved_local_value)); if (!CouldWriteValue(emboss_reserved_local_value)) return false; return view_.x().TryToWrite( @@ -12917,7 +12338,7 @@ class GenericImplicitWriteBackView final { void UncheckedWrite(::std::int32_t emboss_reserved_local_value) { view_.x().UncheckedWrite((::emboss::support::Difference(::emboss::support::Maybe(static_cast(10LL)), ::emboss::support::Maybe(emboss_reserved_local_value))).ValueOrDefault()); } - bool CouldWriteValue(::std::int32_t emboss_reserved_local_value) { + [[nodiscard]] bool CouldWriteValue(::std::int32_t emboss_reserved_local_value) { if (!ValueIsOk(emboss_reserved_local_value)) return false; const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Difference(::emboss::support::Maybe(static_cast(10LL)), ::emboss::support::Maybe(emboss_reserved_local_value)); if (!emboss_reserved_local_maybe_new_value.Known()) return false; @@ -12933,7 +12354,7 @@ class GenericImplicitWriteBackView final { private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Difference(::emboss::support::Maybe(static_cast(10LL)), emboss_reserved_local_subexpr_2); @@ -12941,7 +12362,7 @@ class GenericImplicitWriteBackView final { return emboss_reserved_local_subexpr_3; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -12949,8 +12370,8 @@ class GenericImplicitWriteBackView final { const GenericImplicitWriteBackView view_; }; - EmbossReservedVirtualTenMinusXView ten_minus_x() const; - ::emboss::support::Maybe has_ten_minus_x() const; + [[nodiscard]] EmbossReservedVirtualTenMinusXView ten_minus_x() const; + [[nodiscard]] ::emboss::support::Maybe has_ten_minus_x() const; public: class EmbossReservedVirtualTenMinusXPlusTenView final { @@ -12969,17 +12390,17 @@ class GenericImplicitWriteBackView final { default; ~EmbossReservedVirtualTenMinusXPlusTenView() = default; - ::std::int32_t Read() const { + [[nodiscard]] ::std::int32_t Read() const { EMBOSS_CHECK(view_.has_ten_minus_x_plus_ten().ValueOr(false)); auto emboss_reserved_local_value = MaybeRead(); EMBOSS_CHECK(emboss_reserved_local_value.Known()); EMBOSS_CHECK(ValueIsOk(emboss_reserved_local_value.ValueOrDefault())); return emboss_reserved_local_value.ValueOrDefault(); } - ::std::int32_t UncheckedRead() const { + [[nodiscard]] ::std::int32_t UncheckedRead() const { return MaybeRead().ValueOrDefault(); } - bool Ok() const { + [[nodiscard]] bool Ok() const { auto emboss_reserved_local_value = MaybeRead(); return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); @@ -12992,9 +12413,9 @@ class GenericImplicitWriteBackView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } - bool TryToWrite(::std::int32_t emboss_reserved_local_value) { + [[nodiscard]] bool TryToWrite(::std::int32_t emboss_reserved_local_value) { const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Difference(::emboss::support::Maybe(static_cast(10LL)), ::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(10LL)))); if (!CouldWriteValue(emboss_reserved_local_value)) return false; return view_.x().TryToWrite( @@ -13008,7 +12429,7 @@ class GenericImplicitWriteBackView final { void UncheckedWrite(::std::int32_t emboss_reserved_local_value) { view_.x().UncheckedWrite((::emboss::support::Difference(::emboss::support::Maybe(static_cast(10LL)), ::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(10LL))))).ValueOrDefault()); } - bool CouldWriteValue(::std::int32_t emboss_reserved_local_value) { + [[nodiscard]] bool CouldWriteValue(::std::int32_t emboss_reserved_local_value) { if (!ValueIsOk(emboss_reserved_local_value)) return false; const auto emboss_reserved_local_maybe_new_value = ::emboss::support::Difference(::emboss::support::Maybe(static_cast(10LL)), ::emboss::support::Difference(::emboss::support::Maybe(emboss_reserved_local_value), ::emboss::support::Maybe(static_cast(10LL)))); if (!emboss_reserved_local_maybe_new_value.Known()) return false; @@ -13024,7 +12445,7 @@ class GenericImplicitWriteBackView final { private: - ::emboss::support::Maybe MaybeRead() const { + [[nodiscard]] ::emboss::support::Maybe MaybeRead() const { const auto emboss_reserved_local_subexpr_1 = view_.x(); const auto emboss_reserved_local_subexpr_2 = (emboss_reserved_local_subexpr_1.Ok() ? ::emboss::support::Maybe(static_cast(emboss_reserved_local_subexpr_1.UncheckedRead())) : ::emboss::support::Maybe()); const auto emboss_reserved_local_subexpr_3 = ::emboss::support::Difference(::emboss::support::Maybe(static_cast(10LL)), emboss_reserved_local_subexpr_2); @@ -13033,7 +12454,7 @@ class GenericImplicitWriteBackView final { return emboss_reserved_local_subexpr_4; } - static constexpr bool ValueIsOk( + [[nodiscard]] static constexpr bool ValueIsOk( ::std::int32_t emboss_reserved_local_value) { return (void)emboss_reserved_local_value, // Silence -Wunused-parameter ::emboss::support::Maybe(true).ValueOr(false); @@ -13041,8 +12462,8 @@ class GenericImplicitWriteBackView final { const GenericImplicitWriteBackView view_; }; - EmbossReservedVirtualTenMinusXPlusTenView ten_minus_x_plus_ten() const; - ::emboss::support::Maybe has_ten_minus_x_plus_ten() const; + [[nodiscard]] EmbossReservedVirtualTenMinusXPlusTenView ten_minus_x_plus_ten() const; + [[nodiscard]] ::emboss::support::Maybe has_ten_minus_x_plus_ten() const; public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -13058,9 +12479,9 @@ class GenericImplicitWriteBackView final { default; ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -13069,13 +12490,13 @@ class GenericImplicitWriteBackView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_IntrinsicSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -13093,9 +12514,9 @@ class GenericImplicitWriteBackView final { default; ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -13104,13 +12525,13 @@ class GenericImplicitWriteBackView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { return EmbossReservedDollarVirtualMaxSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MaxSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -13128,9 +12549,9 @@ class GenericImplicitWriteBackView final { default; ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; - static constexpr ::std::int32_t Read(); - static constexpr ::std::int32_t UncheckedRead(); - static constexpr bool Ok() { return true; } + [[nodiscard]] static constexpr ::std::int32_t Read(); + [[nodiscard]] static constexpr ::std::int32_t UncheckedRead(); + [[nodiscard]] static constexpr bool Ok() { return true; } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -13139,13 +12560,13 @@ class GenericImplicitWriteBackView final { this, emboss_reserved_local_stream, emboss_reserved_local_options); } - static constexpr bool IsAggregate() { return false; } + [[nodiscard]] static constexpr bool IsAggregate() { return false; } }; - static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { + [[nodiscard]] static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { return EmbossReservedDollarVirtualMinSizeInBytesView(); } - static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { + [[nodiscard]] static constexpr ::emboss::support::Maybe has_MinSizeInBytes() { return ::emboss::support::Maybe(true); } @@ -13176,7 +12597,7 @@ struct EmbossReservedInternalIsGenericImplicitWriteBackView< }; template -inline GenericImplicitWriteBackView< +[[nodiscard]] inline GenericImplicitWriteBackView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -13191,7 +12612,7 @@ MakeImplicitWriteBackView( T &&emboss_reserved_local_arg) { } template -inline GenericImplicitWriteBackView> +[[nodiscard]] inline GenericImplicitWriteBackView> MakeImplicitWriteBackView( T *emboss_reserved_local_data, ::std::size_t emboss_reserved_local_size) { return GenericImplicitWriteBackView>( @@ -13200,7 +12621,7 @@ MakeImplicitWriteBackView( T *emboss_reserved_local_data, } template -inline GenericImplicitWriteBackView< +[[nodiscard]] inline GenericImplicitWriteBackView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedImplicitWriteBackView( T *emboss_reserved_local_data,