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..9a32f50 100644 --- a/compiler/back_end/cpp/generated_code_templates +++ b/compiler/back_end/cpp/generated_code_templates @@ -124,15 +124,16 @@ class Generic${name}View final { ${enum_usings} - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; ${parameter_ok_checks} +${ok_subexpressions} ${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( @@ -141,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; } @@ -171,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(), @@ -180,7 +181,7 @@ ${size_method} ${text_stream_methods} - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } ${field_method_declarations} @@ -215,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, @@ -230,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>( @@ -239,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, @@ -374,28 +375,31 @@ ${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 ** //////////////////////////////////////////////////////// // 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 ** //////////////////////////////////////////////////// @@ -487,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 ** ///////////////////////////// @@ -543,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 @@ -554,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); } @@ -603,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: @@ -644,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()); @@ -657,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); @@ -675,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( @@ -694,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; @@ -727,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 ** /////////////////////// @@ -745,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 5860bc8..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,6 +799,14 @@ def subexprs(self): 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( "ExpressionResult", ["rendered", "is_constant"] @@ -804,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: @@ -871,7 +888,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): @@ -983,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, @@ -1137,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: @@ -1330,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). @@ -1353,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 = [] @@ -1421,6 +1577,8 @@ def _generate_structure_definition(type_ir, ir, config: Config): initialize_parameters_initialized_true = "" parameter_checks = [""] + # 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( @@ -1428,12 +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) + "()", - ) - ) if not ir_util.field_is_virtual(field): # Virtual fields do not participate in equality tests -- they are equal by # definition. @@ -1490,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 ) @@ -1498,7 +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), + 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/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/__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 e60daf5..28b0042 100644 --- a/testdata/golden_cpp/alignments.emb.h +++ b/testdata/golden_cpp/alignments.emb.h @@ -113,85 +113,50 @@ class GenericAlignmentsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_zero_offset().Known()) return false; - if (has_zero_offset().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; - - - if (!has_two_offset_substructure().Known()) return false; - if (has_two_offset_substructure().ValueOrDefault() && !two_offset_substructure().Ok()) return false; - - - if (!has_three_offset().Known()) return false; - if (has_three_offset().ValueOrDefault() && !three_offset().Ok()) return false; - - - if (!has_four_offset().Known()) return false; - if (has_four_offset().ValueOrDefault() && !four_offset().Ok()) return false; - - - if (!has_eleven_offset().Known()) return false; - if (has_eleven_offset().ValueOrDefault() && !eleven_offset().Ok()) return false; - - - if (!has_twelve_offset().Known()) return false; - if (has_twelve_offset().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; - - - 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; - - - 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; - - - 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; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -382,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) && @@ -555,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(), @@ -1030,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 { @@ -1128,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 @@ -1139,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); } @@ -1163,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 @@ -1174,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); } @@ -1198,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 @@ -1209,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); } @@ -1246,7 +1211,7 @@ struct EmbossReservedInternalIsGenericAlignmentsView< }; template -inline GenericAlignmentsView< +[[nodiscard]] inline GenericAlignmentsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1261,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>( @@ -1270,7 +1235,7 @@ MakeAlignmentsView( T *emboss_reserved_local_data, } template -inline GenericAlignmentsView< +[[nodiscard]] inline GenericAlignmentsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedAlignmentsView( T *emboss_reserved_local_data, @@ -1335,45 +1300,40 @@ class GenericPlaceholder4View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_dummy().Known()) return false; - if (has_dummy().ValueOrDefault() && !dummy().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -1394,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) && @@ -1427,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(), @@ -1522,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 { @@ -1546,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 @@ -1557,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); } @@ -1581,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 @@ -1592,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); } @@ -1616,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 @@ -1627,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); } @@ -1664,7 +1624,7 @@ struct EmbossReservedInternalIsGenericPlaceholder4View< }; template -inline GenericPlaceholder4View< +[[nodiscard]] inline GenericPlaceholder4View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1679,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>( @@ -1688,7 +1648,7 @@ MakePlaceholder4View( T *emboss_reserved_local_data, } template -inline GenericPlaceholder4View< +[[nodiscard]] inline GenericPlaceholder4View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedPlaceholder4View( T *emboss_reserved_local_data, @@ -1754,49 +1714,41 @@ class GenericPlaceholder6View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_zero_offset().Known()) return false; - if (has_zero_offset().ValueOrDefault() && !zero_offset().Ok()) return false; - - - if (!has_two_offset().Known()) return false; - if (has_two_offset().ValueOrDefault() && !two_offset().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -1834,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) && @@ -1881,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(), @@ -2014,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 { @@ -2042,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 @@ -2053,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); } @@ -2077,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 @@ -2088,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); } @@ -2112,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 @@ -2123,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); } @@ -2160,7 +2112,7 @@ struct EmbossReservedInternalIsGenericPlaceholder6View< }; template -inline GenericPlaceholder6View< +[[nodiscard]] inline GenericPlaceholder6View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2175,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>( @@ -2184,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 7d505c9..bc2c174 100644 --- a/testdata/golden_cpp/anonymous_bits.emb.h +++ b/testdata/golden_cpp/anonymous_bits.emb.h @@ -119,53 +119,42 @@ class GenericEmbossReservedAnonymousField2View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_high_bit().Known()) return false; - if (has_high_bit().ValueOrDefault() && !high_bit().Ok()) return false; - - - if (!has_bar().Known()) return false; - if (has_bar().ValueOrDefault() && !bar().Ok()) return false; - - - if (!has_first_bit().Known()) return false; - if (has_first_bit().ValueOrDefault() && !first_bit().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -220,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) && @@ -281,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(), @@ -452,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 { @@ -493,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 @@ -504,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); } @@ -528,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 @@ -539,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); } @@ -563,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 @@ -574,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); } @@ -611,7 +600,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField2View< }; template -inline GenericEmbossReservedAnonymousField2View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField2View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -626,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>( @@ -635,7 +624,7 @@ MakeEmbossReservedAnonymousField2View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField2View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField2View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField2View( T *emboss_reserved_local_data, @@ -790,49 +779,41 @@ class GenericEmbossReservedAnonymousField1View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_bit_23().Known()) return false; - if (has_bit_23().ValueOrDefault() && !bit_23().Ok()) return false; - - - if (!has_low_bit().Known()) return false; - if (has_low_bit().ValueOrDefault() && !low_bit().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -870,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) && @@ -917,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(), @@ -1050,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 { @@ -1082,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 @@ -1093,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); } @@ -1117,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 @@ -1128,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); } @@ -1152,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 @@ -1163,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); } @@ -1200,7 +1181,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField1View< }; template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1215,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>( @@ -1224,7 +1205,7 @@ MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, @@ -1285,69 +1266,53 @@ class GenericFooView final { using Bar = ::emboss::test::Foo::Bar; - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_high_bit().Known()) return false; - if (has_high_bit().ValueOrDefault() && !high_bit().Ok()) return false; - - - if (!has_bar().Known()) return false; - if (has_bar().ValueOrDefault() && !bar().Ok()) return false; - - - if (!has_first_bit().Known()) return false; - if (has_first_bit().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; - - - if (!has_bit_23().Known()) return false; - if (has_bit_23().ValueOrDefault() && !bit_23().Ok()) return false; - - - if (!has_low_bit().Known()) return false; - if (has_low_bit().ValueOrDefault() && !low_bit().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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; @@ -1385,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) && @@ -1432,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(), @@ -1679,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 { @@ -1742,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 @@ -1753,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); } @@ -1777,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 @@ -1788,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); } @@ -1812,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 @@ -1823,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); } @@ -1860,7 +1825,7 @@ struct EmbossReservedInternalIsGenericFooView< }; template -inline GenericFooView< +[[nodiscard]] inline GenericFooView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1875,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>( @@ -1884,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 64e2973..e4b01f4 100644 --- a/testdata/golden_cpp/auto_array_size.emb.h +++ b/testdata/golden_cpp/auto_array_size.emb.h @@ -96,49 +96,41 @@ class GenericElementView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; - - - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -176,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) && @@ -223,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(), @@ -356,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 { @@ -388,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 @@ -399,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); } @@ -423,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 @@ -434,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); } @@ -458,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 @@ -469,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); } @@ -506,7 +498,7 @@ struct EmbossReservedInternalIsGenericElementView< }; template -inline GenericElementView< +[[nodiscard]] inline GenericElementView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -521,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>( @@ -530,7 +522,7 @@ MakeElementView( T *emboss_reserved_local_data, } template -inline GenericElementView< +[[nodiscard]] inline GenericElementView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedElementView( T *emboss_reserved_local_data, @@ -599,60 +591,43 @@ class GenericAutoSizeView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_array_size().Known()) return false; - if (has_array_size().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; - - - if (!has_four_struct_array().Known()) return false; - if (has_four_struct_array().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; - - - if (!has_dynamic_struct_array().Known()) return false; - if (has_dynamic_struct_array().ValueOrDefault() && !dynamic_struct_array().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -741,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) && @@ -830,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(), @@ -1077,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>> @@ -1097,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>> @@ -1119,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 { @@ -1148,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()); @@ -1171,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); @@ -1189,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); @@ -1197,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 { @@ -1214,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 @@ -1225,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); } @@ -1249,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 @@ -1260,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); } @@ -1297,7 +1272,7 @@ struct EmbossReservedInternalIsGenericAutoSizeView< }; template -inline GenericAutoSizeView< +[[nodiscard]] inline GenericAutoSizeView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1312,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>( @@ -1321,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 1e4edc2..a92c0b0 100644 --- a/testdata/golden_cpp/bcd.emb.h +++ b/testdata/golden_cpp/bcd.emb.h @@ -122,57 +122,43 @@ class GenericEmbossReservedAnonymousField1View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_four_bit().Known()) return false; - if (has_four_bit().ValueOrDefault() && !four_bit().Ok()) return false; - - - if (!has_six_bit().Known()) return false; - if (has_six_bit().ValueOrDefault() && !six_bit().Ok()) return false; - - - if (!has_ten_bit().Known()) return false; - if (has_ten_bit().ValueOrDefault() && !ten_bit().Ok()) return false; - - - if (!has_twelve_bit().Known()) return false; - if (has_twelve_bit().ValueOrDefault() && !twelve_bit().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -244,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) && @@ -319,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(), @@ -528,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 { @@ -576,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 @@ -587,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); } @@ -611,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 @@ -622,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); } @@ -646,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 @@ -657,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); } @@ -694,7 +680,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField1View< }; template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -709,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>( @@ -718,7 +704,7 @@ MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, @@ -779,93 +765,59 @@ class GenericBcdSizesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; - - - if (!has_two_byte().Known()) return false; - if (has_two_byte().ValueOrDefault() && !two_byte().Ok()) return false; - - - if (!has_three_byte().Known()) return false; - if (has_three_byte().ValueOrDefault() && !three_byte().Ok()) return false; - - - if (!has_four_byte().Known()) return false; - if (has_four_byte().ValueOrDefault() && !four_byte().Ok()) return false; - - - if (!has_five_byte().Known()) return false; - if (has_five_byte().ValueOrDefault() && !five_byte().Ok()) return false; - - - if (!has_six_byte().Known()) return false; - if (has_six_byte().ValueOrDefault() && !six_byte().Ok()) return false; - - - if (!has_seven_byte().Known()) return false; - if (has_seven_byte().ValueOrDefault() && !seven_byte().Ok()) return false; - - - if (!has_eight_byte().Known()) return false; - if (has_eight_byte().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; - - - if (!has_four_bit().Known()) return false; - if (has_four_bit().ValueOrDefault() && !four_bit().Ok()) return false; - - - if (!has_six_bit().Known()) return false; - if (has_six_bit().ValueOrDefault() && !six_bit().Ok()) return false; - - - if (!has_ten_bit().Known()) return false; - if (has_ten_bit().ValueOrDefault() && !ten_bit().Ok()) return false; - - - if (!has_twelve_bit().Known()) return false; - if (has_twelve_bit().ValueOrDefault() && !twelve_bit().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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; @@ -1022,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) && @@ -1167,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(), @@ -1680,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 { @@ -1794,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 @@ -1805,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); } @@ -1829,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 @@ -1840,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); } @@ -1864,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 @@ -1875,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); } @@ -1912,7 +1864,7 @@ struct EmbossReservedInternalIsGenericBcdSizesView< }; template -inline GenericBcdSizesView< +[[nodiscard]] inline GenericBcdSizesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1927,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>( @@ -1936,7 +1888,7 @@ MakeBcdSizesView( T *emboss_reserved_local_data, } template -inline GenericBcdSizesView< +[[nodiscard]] inline GenericBcdSizesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedBcdSizesView( T *emboss_reserved_local_data, @@ -2001,45 +1953,40 @@ class GenericBcdBigEndianView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_four_byte().Known()) return false; - if (has_four_byte().ValueOrDefault() && !four_byte().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -2060,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) && @@ -2093,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(), @@ -2188,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 { @@ -2212,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 @@ -2223,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); } @@ -2247,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 @@ -2258,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); } @@ -2282,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 @@ -2293,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); } @@ -2330,7 +2277,7 @@ struct EmbossReservedInternalIsGenericBcdBigEndianView< }; template -inline GenericBcdBigEndianView< +[[nodiscard]] inline GenericBcdBigEndianView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2345,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>( @@ -2354,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 e6f29da..1045e59 100644 --- a/testdata/golden_cpp/bits.emb.h +++ b/testdata/golden_cpp/bits.emb.h @@ -139,61 +139,44 @@ class GenericOneByteView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_high_bit().Known()) return false; - if (has_high_bit().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; - - - if (!has_mid_nibble().Known()) return false; - if (has_mid_nibble().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; - - - if (!has_low_bit().Known()) return false; - if (has_low_bit().ValueOrDefault() && !low_bit().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -282,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) && @@ -371,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(), @@ -618,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 { @@ -674,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 @@ -685,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); } @@ -709,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 @@ -720,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); } @@ -744,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 @@ -755,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); } @@ -792,7 +775,7 @@ struct EmbossReservedInternalIsGenericOneByteView< }; template -inline GenericOneByteView< +[[nodiscard]] inline GenericOneByteView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -807,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>( @@ -816,7 +799,7 @@ MakeOneByteView( T *emboss_reserved_local_data, } template -inline GenericOneByteView< +[[nodiscard]] inline GenericOneByteView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedOneByteView( T *emboss_reserved_local_data, @@ -904,53 +887,42 @@ class GenericTwoByteWithGapsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_high_bit().Known()) return false; - if (has_high_bit().ValueOrDefault() && !high_bit().Ok()) return false; - - - if (!has_mid_nibble().Known()) return false; - if (has_mid_nibble().ValueOrDefault() && !mid_nibble().Ok()) return false; - - - if (!has_low_bit().Known()) return false; - if (has_low_bit().ValueOrDefault() && !low_bit().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -1005,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) && @@ -1066,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(), @@ -1237,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 { @@ -1277,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 @@ -1288,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); } @@ -1312,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 @@ -1323,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); } @@ -1347,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 @@ -1358,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); } @@ -1395,7 +1367,7 @@ struct EmbossReservedInternalIsGenericTwoByteWithGapsView< }; template -inline GenericTwoByteWithGapsView< +[[nodiscard]] inline GenericTwoByteWithGapsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1410,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>( @@ -1419,7 +1391,7 @@ MakeTwoByteWithGapsView( T *emboss_reserved_local_data, } template -inline GenericTwoByteWithGapsView< +[[nodiscard]] inline GenericTwoByteWithGapsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedTwoByteWithGapsView( T *emboss_reserved_local_data, @@ -1480,61 +1452,44 @@ class GenericFourByteView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_high_nibble().Known()) return false; - if (has_high_nibble().ValueOrDefault() && !high_nibble().Ok()) return false; - - - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; - - - if (!has_two_byte().Known()) return false; - if (has_two_byte().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; - - - if (!has_low_nibble().Known()) return false; - if (has_low_nibble().ValueOrDefault() && !low_nibble().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -1606,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) && @@ -1681,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(), @@ -1928,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 { @@ -1975,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()); @@ -1998,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( @@ -2014,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; @@ -2030,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))); @@ -2038,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); @@ -2046,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 { @@ -2063,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 @@ -2074,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); } @@ -2098,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 @@ -2109,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); } @@ -2133,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 @@ -2144,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); } @@ -2181,7 +2136,7 @@ struct EmbossReservedInternalIsGenericFourByteView< }; template -inline GenericFourByteView< +[[nodiscard]] inline GenericFourByteView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2196,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>( @@ -2205,7 +2160,7 @@ MakeFourByteView( T *emboss_reserved_local_data, } template -inline GenericFourByteView< +[[nodiscard]] inline GenericFourByteView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedFourByteView( T *emboss_reserved_local_data, @@ -2271,49 +2226,41 @@ class GenericArrayInBitsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_lone_flag().Known()) return false; - if (has_lone_flag().ValueOrDefault() && !lone_flag().Ok()) return false; - - - if (!has_flags().Known()) return false; - if (has_flags().ValueOrDefault() && !flags().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -2351,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) && @@ -2398,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(), @@ -2531,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> @@ -2551,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 { @@ -2567,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 @@ -2578,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); } @@ -2602,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 @@ -2613,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); } @@ -2637,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 @@ -2648,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); } @@ -2685,7 +2632,7 @@ struct EmbossReservedInternalIsGenericArrayInBitsView< }; template -inline GenericArrayInBitsView< +[[nodiscard]] inline GenericArrayInBitsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2700,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>( @@ -2709,7 +2656,7 @@ MakeArrayInBitsView( T *emboss_reserved_local_data, } template -inline GenericArrayInBitsView< +[[nodiscard]] inline GenericArrayInBitsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedArrayInBitsView( T *emboss_reserved_local_data, @@ -2774,45 +2721,40 @@ class GenericArrayInBitsInStructView final { - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -2833,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) && @@ -2866,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(), @@ -2961,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 { @@ -2983,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 @@ -2994,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); } @@ -3018,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 @@ -3029,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); } @@ -3053,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 @@ -3064,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); } @@ -3101,7 +3043,7 @@ struct EmbossReservedInternalIsGenericArrayInBitsInStructView< }; template -inline GenericArrayInBitsInStructView< +[[nodiscard]] inline GenericArrayInBitsInStructView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3116,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>( @@ -3125,7 +3067,7 @@ MakeArrayInBitsInStructView( T *emboss_reserved_local_data, } template -inline GenericArrayInBitsInStructView< +[[nodiscard]] inline GenericArrayInBitsInStructView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedArrayInBitsInStructView( T *emboss_reserved_local_data, @@ -3193,56 +3135,42 @@ class GenericStructOfBitsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; - - - if (!has_two_byte().Known()) return false; - if (has_two_byte().ValueOrDefault() && !two_byte().Ok()) return false; - - - if (!has_four_byte().Known()) return false; - if (has_four_byte().ValueOrDefault() && !four_byte().Ok()) return false; - - - if (!has_located_byte().Known()) return false; - if (has_located_byte().ValueOrDefault() && !located_byte().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -3314,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) && @@ -3389,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(), @@ -3598,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 { @@ -3643,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()); @@ -3666,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))); @@ -3681,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); @@ -3689,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 { @@ -3706,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 @@ -3717,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); } @@ -3741,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 @@ -3752,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); } @@ -3789,7 +3717,7 @@ struct EmbossReservedInternalIsGenericStructOfBitsView< }; template -inline GenericStructOfBitsView< +[[nodiscard]] inline GenericStructOfBitsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3804,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>( @@ -3813,7 +3741,7 @@ MakeStructOfBitsView( T *emboss_reserved_local_data, } template -inline GenericStructOfBitsView< +[[nodiscard]] inline GenericStructOfBitsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructOfBitsView( T *emboss_reserved_local_data, @@ -3878,45 +3806,40 @@ class GenericBitArrayView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -3937,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) && @@ -3970,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(), @@ -4065,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 { @@ -4091,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 @@ -4102,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); } @@ -4126,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 @@ -4137,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); } @@ -4161,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 @@ -4172,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); } @@ -4209,7 +4132,7 @@ struct EmbossReservedInternalIsGenericBitArrayView< }; template -inline GenericBitArrayView< +[[nodiscard]] inline GenericBitArrayView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4224,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>( @@ -4233,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 31889b0..eff386c 100644 --- a/testdata/golden_cpp/complex_offset.emb.h +++ b/testdata/golden_cpp/complex_offset.emb.h @@ -103,45 +103,40 @@ class GenericLengthView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_length().Known()) return false; - if (has_length().ValueOrDefault() && !length().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -162,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) && @@ -195,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(), @@ -290,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 { @@ -314,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 @@ -325,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); } @@ -349,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 @@ -360,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); } @@ -384,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 @@ -395,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); } @@ -432,7 +427,7 @@ struct EmbossReservedInternalIsGenericLengthView< }; template -inline GenericLengthView< +[[nodiscard]] inline GenericLengthView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -447,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>( @@ -456,7 +451,7 @@ MakeLengthView( T *emboss_reserved_local_data, } template -inline GenericLengthView< +[[nodiscard]] inline GenericLengthView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedLengthView( T *emboss_reserved_local_data, @@ -522,48 +517,40 @@ class GenericDataView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_length().Known()) return false; - if (has_length().ValueOrDefault() && !length().Ok()) return false; - - - if (!has_data().Known()) return false; - if (has_data().ValueOrDefault() && !data().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -601,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) && @@ -648,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(), @@ -781,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>> @@ -799,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 { @@ -818,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()); @@ -841,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); @@ -856,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); @@ -864,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 { @@ -881,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 @@ -892,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); } @@ -916,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 @@ -927,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); } @@ -964,7 +951,7 @@ struct EmbossReservedInternalIsGenericDataView< }; template -inline GenericDataView< +[[nodiscard]] inline GenericDataView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -979,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>( @@ -988,7 +975,7 @@ MakeDataView( T *emboss_reserved_local_data, } template -inline GenericDataView< +[[nodiscard]] inline GenericDataView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedDataView( T *emboss_reserved_local_data, @@ -1069,108 +1056,55 @@ class GenericPackedFieldsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_length1().Known()) return false; - if (has_length1().ValueOrDefault() && !length1().Ok()) return false; - - - if (!has_data1().Known()) return false; - if (has_data1().ValueOrDefault() && !data1().Ok()) return false; - - - if (!has_o1().Known()) return false; - if (has_o1().ValueOrDefault() && !o1().Ok()) return false; - - - if (!has_length2().Known()) return false; - if (has_length2().ValueOrDefault() && !length2().Ok()) return false; - - - if (!has_data2().Known()) return false; - if (has_data2().ValueOrDefault() && !data2().Ok()) return false; - - - if (!has_o2().Known()) return false; - if (has_o2().ValueOrDefault() && !o2().Ok()) return false; - - - if (!has_length3().Known()) return false; - if (has_length3().ValueOrDefault() && !length3().Ok()) return false; - - - if (!has_data3().Known()) return false; - if (has_data3().ValueOrDefault() && !data3().Ok()) return false; - - - if (!has_o3().Known()) return false; - if (has_o3().ValueOrDefault() && !o3().Ok()) return false; - - - if (!has_length4().Known()) return false; - if (has_length4().ValueOrDefault() && !length4().Ok()) return false; - - - if (!has_data4().Known()) return false; - if (has_data4().ValueOrDefault() && !data4().Ok()) return false; - - - if (!has_o4().Known()) return false; - if (has_o4().ValueOrDefault() && !o4().Ok()) return false; - - - if (!has_length5().Known()) return false; - if (has_length5().ValueOrDefault() && !length5().Ok()) return false; - - - if (!has_data5().Known()) return false; - if (has_data5().ValueOrDefault() && !data5().Ok()) return false; - - - if (!has_o5().Known()) return false; - if (has_o5().ValueOrDefault() && !o5().Ok()) return false; - - - if (!has_length6().Known()) return false; - if (has_length6().ValueOrDefault() && !length6().Ok()) return false; - - - if (!has_data6().Known()) return false; - if (has_data6().ValueOrDefault() && !data6().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -1378,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) && @@ -1565,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(), @@ -2173,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 { @@ -2204,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()); @@ -2227,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); @@ -2247,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 { @@ -2279,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()); @@ -2302,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(); @@ -2317,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); @@ -2325,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 { @@ -2357,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()); @@ -2380,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(); @@ -2395,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); @@ -2403,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 { @@ -2435,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()); @@ -2458,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(); @@ -2473,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); @@ -2481,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 { @@ -2513,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()); @@ -2536,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(); @@ -2551,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); @@ -2559,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 { @@ -2591,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()); @@ -2614,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))); @@ -2675,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); @@ -2683,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 { @@ -2700,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 @@ -2711,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); } @@ -2735,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 @@ -2746,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); } @@ -2783,7 +2717,7 @@ struct EmbossReservedInternalIsGenericPackedFieldsView< }; template -inline GenericPackedFieldsView< +[[nodiscard]] inline GenericPackedFieldsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2798,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>( @@ -2807,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 745976a..39af2e7 100644 --- a/testdata/golden_cpp/complex_structure.emb.h +++ b/testdata/golden_cpp/complex_structure.emb.h @@ -112,53 +112,42 @@ class GenericRegisterLayoutView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_l().Known()) return false; - if (has_l().ValueOrDefault() && !l().Ok()) return false; - - - if (!has_h().Known()) return false; - if (has_h().ValueOrDefault() && !h().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -213,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) && @@ -274,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(), @@ -445,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 { @@ -485,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 @@ -496,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); } @@ -520,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 @@ -531,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); } @@ -555,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 @@ -566,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); } @@ -603,7 +592,7 @@ struct EmbossReservedInternalIsGenericRegisterLayoutView< }; template -inline GenericRegisterLayoutView< +[[nodiscard]] inline GenericRegisterLayoutView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -618,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>( @@ -627,7 +616,7 @@ MakeRegisterLayoutView( T *emboss_reserved_local_data, } template -inline GenericRegisterLayoutView< +[[nodiscard]] inline GenericRegisterLayoutView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedRegisterLayoutView( T *emboss_reserved_local_data, @@ -692,45 +681,40 @@ class GenericArrayElementView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -751,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) && @@ -784,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(), @@ -879,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 { @@ -901,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 @@ -912,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); } @@ -936,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 @@ -947,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); } @@ -971,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 @@ -982,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); } @@ -1019,7 +1003,7 @@ struct EmbossReservedInternalIsGenericArrayElementView< }; template -inline GenericArrayElementView< +[[nodiscard]] inline GenericArrayElementView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1034,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>( @@ -1043,7 +1027,7 @@ MakeArrayElementView( T *emboss_reserved_local_data, } template -inline GenericArrayElementView< +[[nodiscard]] inline GenericArrayElementView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedArrayElementView( T *emboss_reserved_local_data, @@ -1131,57 +1115,43 @@ class GenericEmbossReservedAnonymousField1View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_a0().Known()) return false; - if (has_a0().ValueOrDefault() && !a0().Ok()) return false; - - - if (!has_s0().Known()) return false; - if (has_s0().ValueOrDefault() && !s0().Ok()) return false; - - - if (!has_l0().Known()) return false; - if (has_l0().ValueOrDefault() && !l0().Ok()) return false; - - - if (!has_h0().Known()) return false; - if (has_h0().ValueOrDefault() && !h0().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -1253,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) && @@ -1328,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(), @@ -1537,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 { @@ -1585,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 @@ -1596,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); } @@ -1620,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 @@ -1631,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); } @@ -1655,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 @@ -1666,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); } @@ -1703,7 +1673,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField1View< }; template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1718,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>( @@ -1727,7 +1697,7 @@ MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, @@ -1788,108 +1758,123 @@ class GenericComplexView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_s().Known()) return false; - if (has_s().ValueOrDefault() && !s().Ok()) return false; - - - if (!has_u().Known()) return false; - if (has_u().ValueOrDefault() && !u().Ok()) return false; - - - if (!has_i().Known()) return false; - if (has_i().ValueOrDefault() && !i().Ok()) return false; - - - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; - - - if (!has_a().Known()) return false; - if (has_a().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; - - - if (!has_a0().Known()) return false; - if (has_a0().ValueOrDefault() && !a0().Ok()) return false; - - - if (!has_s0().Known()) return false; - if (has_s0().ValueOrDefault() && !s0().Ok()) return false; - - - if (!has_l0().Known()) return false; - if (has_l0().ValueOrDefault() && !l0().Ok()) return false; - - - if (!has_h0().Known()) return false; - if (has_h0().ValueOrDefault() && !h0().Ok()) return false; - - - if (!has_e1().Known()) return false; - if (has_e1().ValueOrDefault() && !e1().Ok()) return false; - - - if (!has_e2().Known()) return false; - if (has_e2().ValueOrDefault() && !e2().Ok()) return false; - - - if (!has_b2().Known()) return false; - if (has_b2().ValueOrDefault() && !b2().Ok()) return false; - - - if (!has_e3().Known()) return false; - if (has_e3().ValueOrDefault() && !e3().Ok()) return false; - - - if (!has_e4().Known()) return false; - if (has_e4().ValueOrDefault() && !e4().Ok()) return false; - - - if (!has_e5().Known()) return false; - if (has_e5().ValueOrDefault() && !e5().Ok()) return false; - - - if (!has_e0().Known()) return false; - if (has_e0().ValueOrDefault() && !e0().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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_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_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_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_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_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_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; @@ -2114,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) && @@ -2315,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(), @@ -2980,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> @@ -3026,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 { @@ -3131,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()); @@ -3154,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))); @@ -3199,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); @@ -3207,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 { @@ -3224,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 @@ -3235,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); } @@ -3259,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 @@ -3270,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); } @@ -3307,7 +3292,7 @@ struct EmbossReservedInternalIsGenericComplexView< }; template -inline GenericComplexView< +[[nodiscard]] inline GenericComplexView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3322,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>( @@ -3331,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 9d11fb7..0fb69e8 100644 --- a/testdata/golden_cpp/condition.emb.h +++ b/testdata/golden_cpp/condition.emb.h @@ -357,48 +357,50 @@ class GenericBasicConditionalView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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; @@ -436,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) && @@ -483,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(), @@ -616,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 { @@ -651,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()); @@ -674,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))); @@ -689,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); @@ -697,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 { @@ -714,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 @@ -725,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); } @@ -749,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 @@ -760,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); } @@ -797,7 +799,7 @@ struct EmbossReservedInternalIsGenericBasicConditionalView< }; template -inline GenericBasicConditionalView< +[[nodiscard]] inline GenericBasicConditionalView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -812,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>( @@ -821,7 +823,7 @@ MakeBasicConditionalView( T *emboss_reserved_local_data, } template -inline GenericBasicConditionalView< +[[nodiscard]] inline GenericBasicConditionalView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedBasicConditionalView( T *emboss_reserved_local_data, @@ -887,48 +889,49 @@ class GenericNegativeConditionalView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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::NotEqual(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(0LL))); + + { + 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_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; @@ -966,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) && @@ -1013,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(), @@ -1146,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 { @@ -1181,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()); @@ -1204,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))); @@ -1219,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); @@ -1227,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 { @@ -1244,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 @@ -1255,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); } @@ -1279,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 @@ -1290,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); } @@ -1327,7 +1330,7 @@ struct EmbossReservedInternalIsGenericNegativeConditionalView< }; template -inline GenericNegativeConditionalView< +[[nodiscard]] inline GenericNegativeConditionalView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1342,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>( @@ -1351,7 +1354,7 @@ MakeNegativeConditionalView( T *emboss_reserved_local_data, } template -inline GenericNegativeConditionalView< +[[nodiscard]] inline GenericNegativeConditionalView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedNegativeConditionalView( T *emboss_reserved_local_data, @@ -1418,53 +1421,52 @@ class GenericConditionalAndUnconditionalOverlappingFinalFieldView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_z().Known()) return false; - if (has_z().ValueOrDefault() && !z().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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; @@ -1519,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) && @@ -1580,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(), @@ -1751,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 { @@ -1791,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 @@ -1802,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); } @@ -1826,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 @@ -1837,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); } @@ -1861,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 @@ -1872,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); } @@ -1909,7 +1911,7 @@ struct EmbossReservedInternalIsGenericConditionalAndUnconditionalOverlappingFina }; template -inline GenericConditionalAndUnconditionalOverlappingFinalFieldView< +[[nodiscard]] inline GenericConditionalAndUnconditionalOverlappingFinalFieldView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1924,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>( @@ -1933,7 +1935,7 @@ MakeConditionalAndUnconditionalOverlappingFinalFieldView( T *emboss_reserved_loc } template -inline GenericConditionalAndUnconditionalOverlappingFinalFieldView< +[[nodiscard]] inline GenericConditionalAndUnconditionalOverlappingFinalFieldView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConditionalAndUnconditionalOverlappingFinalFieldView( T *emboss_reserved_local_data, @@ -1999,49 +2001,51 @@ class GenericConditionalBasicConditionalFieldFirstView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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; @@ -2079,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) && @@ -2126,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(), @@ -2259,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 { @@ -2291,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 @@ -2302,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); } @@ -2326,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 @@ -2337,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); } @@ -2361,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 @@ -2372,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); } @@ -2409,7 +2413,7 @@ struct EmbossReservedInternalIsGenericConditionalBasicConditionalFieldFirstView< }; template -inline GenericConditionalBasicConditionalFieldFirstView< +[[nodiscard]] inline GenericConditionalBasicConditionalFieldFirstView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2424,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>( @@ -2433,7 +2437,7 @@ MakeConditionalBasicConditionalFieldFirstView( T *emboss_reserved_local_data, } template -inline GenericConditionalBasicConditionalFieldFirstView< +[[nodiscard]] inline GenericConditionalBasicConditionalFieldFirstView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConditionalBasicConditionalFieldFirstView( T *emboss_reserved_local_data, @@ -2500,52 +2504,51 @@ class GenericConditionalAndDynamicLocationView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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; @@ -2600,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) && @@ -2661,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(), @@ -2832,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 { @@ -2875,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()); @@ -2898,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))); @@ -2916,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); @@ -2924,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 { @@ -2941,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 @@ -2952,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); } @@ -2976,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 @@ -2987,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); } @@ -3024,7 +3027,7 @@ struct EmbossReservedInternalIsGenericConditionalAndDynamicLocationView< }; template -inline GenericConditionalAndDynamicLocationView< +[[nodiscard]] inline GenericConditionalAndDynamicLocationView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3039,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>( @@ -3048,7 +3051,7 @@ MakeConditionalAndDynamicLocationView( T *emboss_reserved_local_data, } template -inline GenericConditionalAndDynamicLocationView< +[[nodiscard]] inline GenericConditionalAndDynamicLocationView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConditionalAndDynamicLocationView( T *emboss_reserved_local_data, @@ -3114,48 +3117,51 @@ class GenericConditionUsesMinIntView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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::Difference(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(9223372036854775680LL))); + + { + 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_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; @@ -3193,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) && @@ -3240,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(), @@ -3373,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 { @@ -3408,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()); @@ -3431,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))); @@ -3447,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); @@ -3455,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 { @@ -3472,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 @@ -3483,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); } @@ -3507,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 @@ -3518,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); } @@ -3555,7 +3561,7 @@ struct EmbossReservedInternalIsGenericConditionUsesMinIntView< }; template -inline GenericConditionUsesMinIntView< +[[nodiscard]] inline GenericConditionUsesMinIntView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3570,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>( @@ -3579,7 +3585,7 @@ MakeConditionUsesMinIntView( T *emboss_reserved_local_data, } template -inline GenericConditionUsesMinIntView< +[[nodiscard]] inline GenericConditionUsesMinIntView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConditionUsesMinIntView( T *emboss_reserved_local_data, @@ -3646,52 +3652,61 @@ class GenericNestedConditionalView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_xcc().Known()) return false; - if (has_xcc().ValueOrDefault() && !xcc().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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 = 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_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_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_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; @@ -3746,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) && @@ -3807,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(), @@ -3978,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 { @@ -4021,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()); @@ -4044,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))); @@ -4063,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); @@ -4071,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 { @@ -4088,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 @@ -4099,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); } @@ -4123,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 @@ -4134,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); } @@ -4171,7 +4186,7 @@ struct EmbossReservedInternalIsGenericNestedConditionalView< }; template -inline GenericNestedConditionalView< +[[nodiscard]] inline GenericNestedConditionalView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4186,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>( @@ -4195,7 +4210,7 @@ MakeNestedConditionalView( T *emboss_reserved_local_data, } template -inline GenericNestedConditionalView< +[[nodiscard]] inline GenericNestedConditionalView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedNestedConditionalView( T *emboss_reserved_local_data, @@ -4262,52 +4277,62 @@ class GenericCorrectNestedConditionalView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_xcc().Known()) return false; - if (has_xcc().ValueOrDefault() && !xcc().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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_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; @@ -4362,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) && @@ -4423,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(), @@ -4594,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 { @@ -4637,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()); @@ -4660,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))); @@ -4680,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); @@ -4688,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 { @@ -4705,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 @@ -4716,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); } @@ -4740,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 @@ -4751,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); } @@ -4788,7 +4813,7 @@ struct EmbossReservedInternalIsGenericCorrectNestedConditionalView< }; template -inline GenericCorrectNestedConditionalView< +[[nodiscard]] inline GenericCorrectNestedConditionalView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4803,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>( @@ -4812,7 +4837,7 @@ MakeCorrectNestedConditionalView( T *emboss_reserved_local_data, } template -inline GenericCorrectNestedConditionalView< +[[nodiscard]] inline GenericCorrectNestedConditionalView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedCorrectNestedConditionalView( T *emboss_reserved_local_data, @@ -4878,49 +4903,47 @@ class GenericAlwaysFalseConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; + } + } + { + 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; @@ -4958,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) && @@ -5005,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(), @@ -5138,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 { @@ -5170,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 @@ -5181,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); } @@ -5205,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 @@ -5216,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); } @@ -5240,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 @@ -5251,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); } @@ -5288,7 +5311,7 @@ struct EmbossReservedInternalIsGenericAlwaysFalseConditionView< }; template -inline GenericAlwaysFalseConditionView< +[[nodiscard]] inline GenericAlwaysFalseConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5303,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>( @@ -5312,7 +5335,7 @@ MakeAlwaysFalseConditionView( T *emboss_reserved_local_data, } template -inline GenericAlwaysFalseConditionView< +[[nodiscard]] inline GenericAlwaysFalseConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedAlwaysFalseConditionView( T *emboss_reserved_local_data, @@ -5377,45 +5400,46 @@ class GenericOnlyAlwaysFalseConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; + } + } + { + 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; @@ -5436,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) && @@ -5469,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(), @@ -5564,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 { @@ -5588,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 @@ -5599,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); } @@ -5623,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 @@ -5634,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); } @@ -5658,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 @@ -5669,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); } @@ -5706,7 +5730,7 @@ struct EmbossReservedInternalIsGenericOnlyAlwaysFalseConditionView< }; template -inline GenericOnlyAlwaysFalseConditionView< +[[nodiscard]] inline GenericOnlyAlwaysFalseConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5721,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>( @@ -5730,7 +5754,7 @@ MakeOnlyAlwaysFalseConditionView( T *emboss_reserved_local_data, } template -inline GenericOnlyAlwaysFalseConditionView< +[[nodiscard]] inline GenericOnlyAlwaysFalseConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedOnlyAlwaysFalseConditionView( T *emboss_reserved_local_data, @@ -5794,46 +5818,44 @@ class GenericEmptyStructView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; } @@ -5853,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(), @@ -5912,7 +5934,7 @@ class GenericEmptyStructView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { @@ -5928,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 @@ -5939,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); } @@ -5963,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 @@ -5974,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); } @@ -5998,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 @@ -6009,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); } @@ -6046,7 +6068,7 @@ struct EmbossReservedInternalIsGenericEmptyStructView< }; template -inline GenericEmptyStructView< +[[nodiscard]] inline GenericEmptyStructView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -6061,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>( @@ -6070,7 +6092,7 @@ MakeEmptyStructView( T *emboss_reserved_local_data, } template -inline GenericEmptyStructView< +[[nodiscard]] inline GenericEmptyStructView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmptyStructView( T *emboss_reserved_local_data, @@ -6137,52 +6159,47 @@ class GenericAlwaysFalseConditionDynamicSizeView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; + } + } + { + 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; @@ -6237,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) && @@ -6298,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(), @@ -6469,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 { @@ -6512,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()); @@ -6535,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))); @@ -6550,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); @@ -6558,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 { @@ -6575,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 @@ -6586,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); } @@ -6610,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 @@ -6621,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); } @@ -6658,7 +6675,7 @@ struct EmbossReservedInternalIsGenericAlwaysFalseConditionDynamicSizeView< }; template -inline GenericAlwaysFalseConditionDynamicSizeView< +[[nodiscard]] inline GenericAlwaysFalseConditionDynamicSizeView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -6673,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>( @@ -6682,7 +6699,7 @@ MakeAlwaysFalseConditionDynamicSizeView( T *emboss_reserved_local_data, } template -inline GenericAlwaysFalseConditionDynamicSizeView< +[[nodiscard]] inline GenericAlwaysFalseConditionDynamicSizeView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedAlwaysFalseConditionDynamicSizeView( T *emboss_reserved_local_data, @@ -6749,53 +6766,52 @@ class GenericConditionDoesNotContributeToSizeView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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; @@ -6850,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) && @@ -6911,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(), @@ -7082,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 { @@ -7122,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 @@ -7133,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); } @@ -7157,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 @@ -7168,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); } @@ -7192,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 @@ -7203,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); } @@ -7240,7 +7256,7 @@ struct EmbossReservedInternalIsGenericConditionDoesNotContributeToSizeView< }; template -inline GenericConditionDoesNotContributeToSizeView< +[[nodiscard]] inline GenericConditionDoesNotContributeToSizeView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -7255,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>( @@ -7264,7 +7280,7 @@ MakeConditionDoesNotContributeToSizeView( T *emboss_reserved_local_data, } template -inline GenericConditionDoesNotContributeToSizeView< +[[nodiscard]] inline GenericConditionDoesNotContributeToSizeView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConditionDoesNotContributeToSizeView( T *emboss_reserved_local_data, @@ -7418,52 +7434,58 @@ class GenericEnumConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_xc2().Known()) return false; - if (has_xc2().ValueOrDefault() && !xc2().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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_cond = emboss_reserved_local_ok_subexpr_3; + if (!emboss_reserved_cond.Known()) return false; + if (emboss_reserved_cond.ValueOrDefault()) { + if (!xc2().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; @@ -7518,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) && @@ -7579,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(), @@ -7750,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 { @@ -7794,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()); @@ -7817,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))); @@ -7834,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); @@ -7842,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 { @@ -7859,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 @@ -7870,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); } @@ -7894,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 @@ -7905,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); } @@ -7942,7 +7964,7 @@ struct EmbossReservedInternalIsGenericEnumConditionView< }; template -inline GenericEnumConditionView< +[[nodiscard]] inline GenericEnumConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -7957,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>( @@ -7966,7 +7988,7 @@ MakeEnumConditionView( T *emboss_reserved_local_data, } template -inline GenericEnumConditionView< +[[nodiscard]] inline GenericEnumConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEnumConditionView( T *emboss_reserved_local_data, @@ -8032,48 +8054,49 @@ class GenericNegativeEnumConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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::NotEqual(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(1))); + + { + 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_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; @@ -8111,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) && @@ -8158,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(), @@ -8291,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 { @@ -8327,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()); @@ -8350,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))); @@ -8365,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); @@ -8373,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 { @@ -8390,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 @@ -8401,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); } @@ -8425,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 @@ -8436,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); } @@ -8473,7 +8496,7 @@ struct EmbossReservedInternalIsGenericNegativeEnumConditionView< }; template -inline GenericNegativeEnumConditionView< +[[nodiscard]] inline GenericNegativeEnumConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -8488,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>( @@ -8497,7 +8520,7 @@ MakeNegativeEnumConditionView( T *emboss_reserved_local_data, } template -inline GenericNegativeEnumConditionView< +[[nodiscard]] inline GenericNegativeEnumConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedNegativeEnumConditionView( T *emboss_reserved_local_data, @@ -8563,48 +8586,49 @@ class GenericLessThanConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(5LL))); + + { + 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_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; @@ -8642,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) && @@ -8689,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(), @@ -8822,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 { @@ -8857,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()); @@ -8880,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))); @@ -8895,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); @@ -8903,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 { @@ -8920,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 @@ -8931,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); } @@ -8955,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 @@ -8966,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); } @@ -9003,7 +9027,7 @@ struct EmbossReservedInternalIsGenericLessThanConditionView< }; template -inline GenericLessThanConditionView< +[[nodiscard]] inline GenericLessThanConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -9018,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>( @@ -9027,7 +9051,7 @@ MakeLessThanConditionView( T *emboss_reserved_local_data, } template -inline GenericLessThanConditionView< +[[nodiscard]] inline GenericLessThanConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedLessThanConditionView( T *emboss_reserved_local_data, @@ -9093,48 +9117,49 @@ class GenericLessThanOrEqualConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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::LessThanOrEqual(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(5LL))); + + { + 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_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; @@ -9172,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) && @@ -9219,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(), @@ -9352,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 { @@ -9387,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()); @@ -9410,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))); @@ -9425,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); @@ -9433,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 { @@ -9450,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 @@ -9461,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); } @@ -9485,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 @@ -9496,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); } @@ -9533,7 +9558,7 @@ struct EmbossReservedInternalIsGenericLessThanOrEqualConditionView< }; template -inline GenericLessThanOrEqualConditionView< +[[nodiscard]] inline GenericLessThanOrEqualConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -9548,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>( @@ -9557,7 +9582,7 @@ MakeLessThanOrEqualConditionView( T *emboss_reserved_local_data, } template -inline GenericLessThanOrEqualConditionView< +[[nodiscard]] inline GenericLessThanOrEqualConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedLessThanOrEqualConditionView( T *emboss_reserved_local_data, @@ -9623,48 +9648,49 @@ class GenericGreaterThanOrEqualConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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::GreaterThanOrEqual(emboss_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(5LL))); + + { + 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_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; @@ -9702,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) && @@ -9749,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(), @@ -9882,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 { @@ -9917,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()); @@ -9940,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))); @@ -9955,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); @@ -9963,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 { @@ -9980,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 @@ -9991,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); } @@ -10015,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 @@ -10026,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); } @@ -10063,7 +10089,7 @@ struct EmbossReservedInternalIsGenericGreaterThanOrEqualConditionView< }; template -inline GenericGreaterThanOrEqualConditionView< +[[nodiscard]] inline GenericGreaterThanOrEqualConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -10078,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>( @@ -10087,7 +10113,7 @@ MakeGreaterThanOrEqualConditionView( T *emboss_reserved_local_data, } template -inline GenericGreaterThanOrEqualConditionView< +[[nodiscard]] inline GenericGreaterThanOrEqualConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedGreaterThanOrEqualConditionView( T *emboss_reserved_local_data, @@ -10153,48 +10179,49 @@ class GenericGreaterThanConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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(5LL))); + + { + 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_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; @@ -10232,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) && @@ -10279,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(), @@ -10412,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 { @@ -10447,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()); @@ -10470,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))); @@ -10485,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); @@ -10493,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 { @@ -10510,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 @@ -10521,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); } @@ -10545,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 @@ -10556,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); } @@ -10593,7 +10620,7 @@ struct EmbossReservedInternalIsGenericGreaterThanConditionView< }; template -inline GenericGreaterThanConditionView< +[[nodiscard]] inline GenericGreaterThanConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -10608,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>( @@ -10617,7 +10644,7 @@ MakeGreaterThanConditionView( T *emboss_reserved_local_data, } template -inline GenericGreaterThanConditionView< +[[nodiscard]] inline GenericGreaterThanConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedGreaterThanConditionView( T *emboss_reserved_local_data, @@ -10684,52 +10711,56 @@ class GenericRangeConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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; @@ -10784,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) && @@ -10845,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(), @@ -11016,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 { @@ -11059,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()); @@ -11082,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); @@ -11103,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); @@ -11111,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 { @@ -11128,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 @@ -11139,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); } @@ -11163,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 @@ -11174,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); } @@ -11211,7 +11242,7 @@ struct EmbossReservedInternalIsGenericRangeConditionView< }; template -inline GenericRangeConditionView< +[[nodiscard]] inline GenericRangeConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -11226,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>( @@ -11235,7 +11266,7 @@ MakeRangeConditionView( T *emboss_reserved_local_data, } template -inline GenericRangeConditionView< +[[nodiscard]] inline GenericRangeConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedRangeConditionView( T *emboss_reserved_local_data, @@ -11302,52 +11333,56 @@ class GenericReverseRangeConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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; @@ -11402,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) && @@ -11463,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(), @@ -11634,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 { @@ -11677,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()); @@ -11700,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); @@ -11721,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); @@ -11729,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 { @@ -11746,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 @@ -11757,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); } @@ -11781,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 @@ -11792,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); } @@ -11829,7 +11864,7 @@ struct EmbossReservedInternalIsGenericReverseRangeConditionView< }; template -inline GenericReverseRangeConditionView< +[[nodiscard]] inline GenericReverseRangeConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -11844,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>( @@ -11853,7 +11888,7 @@ MakeReverseRangeConditionView( T *emboss_reserved_local_data, } template -inline GenericReverseRangeConditionView< +[[nodiscard]] inline GenericReverseRangeConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedReverseRangeConditionView( T *emboss_reserved_local_data, @@ -11920,52 +11955,54 @@ class GenericAndConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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(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_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_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; @@ -12020,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) && @@ -12081,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(), @@ -12252,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 { @@ -12295,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()); @@ -12318,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))); @@ -12337,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); @@ -12345,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 { @@ -12362,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 @@ -12373,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); } @@ -12397,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 @@ -12408,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); } @@ -12445,7 +12482,7 @@ struct EmbossReservedInternalIsGenericAndConditionView< }; template -inline GenericAndConditionView< +[[nodiscard]] inline GenericAndConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -12460,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>( @@ -12469,7 +12506,7 @@ MakeAndConditionView( T *emboss_reserved_local_data, } template -inline GenericAndConditionView< +[[nodiscard]] inline GenericAndConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedAndConditionView( T *emboss_reserved_local_data, @@ -12536,52 +12573,54 @@ class GenericOrConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().ValueOrDefault() && !xc().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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(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_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_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; @@ -12636,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) && @@ -12697,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(), @@ -12868,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 { @@ -12911,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()); @@ -12934,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))); @@ -12953,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); @@ -12961,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 { @@ -12978,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 @@ -12989,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); } @@ -13013,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 @@ -13024,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); } @@ -13061,7 +13100,7 @@ struct EmbossReservedInternalIsGenericOrConditionView< }; template -inline GenericOrConditionView< +[[nodiscard]] inline GenericOrConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -13076,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>( @@ -13085,7 +13124,7 @@ MakeOrConditionView( T *emboss_reserved_local_data, } template -inline GenericOrConditionView< +[[nodiscard]] inline GenericOrConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedOrConditionView( T *emboss_reserved_local_data, @@ -13240,56 +13279,58 @@ class GenericChoiceConditionView final { using Field = ::emboss::test::ChoiceCondition::Field; - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_field().Known()) return false; - if (has_field().ValueOrDefault() && !field().Ok()) return false; - - - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; - - - if (!has_xyc().Known()) return false; - if (has_xyc().ValueOrDefault() && !xyc().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) 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_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_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; @@ -13361,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) && @@ -13436,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(), @@ -13645,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 { @@ -13697,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()); @@ -13720,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))); @@ -13741,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); @@ -13749,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 { @@ -13766,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 @@ -13777,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); } @@ -13801,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 @@ -13812,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); } @@ -13849,7 +13890,7 @@ struct EmbossReservedInternalIsGenericChoiceConditionView< }; template -inline GenericChoiceConditionView< +[[nodiscard]] inline GenericChoiceConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -13864,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>( @@ -13873,7 +13914,7 @@ MakeChoiceConditionView( T *emboss_reserved_local_data, } template -inline GenericChoiceConditionView< +[[nodiscard]] inline GenericChoiceConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedChoiceConditionView( T *emboss_reserved_local_data, @@ -13945,49 +13986,41 @@ class GenericEmbossReservedAnonymousField3View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_has_top().Known()) return false; - if (has_has_top().ValueOrDefault() && !has_top().Ok()) return false; - - - if (!has_has_bottom().Known()) return false; - if (has_has_bottom().ValueOrDefault() && !has_bottom().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -14025,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) && @@ -14072,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(), @@ -14205,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 { @@ -14237,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 @@ -14248,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); } @@ -14272,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 @@ -14283,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); } @@ -14307,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 @@ -14318,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); } @@ -14355,7 +14388,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField3View< }; template -inline GenericEmbossReservedAnonymousField3View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField3View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -14370,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>( @@ -14379,7 +14412,7 @@ MakeEmbossReservedAnonymousField3View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField3View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField3View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField3View( T *emboss_reserved_local_data, @@ -14440,53 +14473,49 @@ class GenericContainsBitsView final { - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_has_top().Known()) return false; - if (has_has_top().ValueOrDefault() && !has_top().Ok()) return false; - - - if (!has_has_bottom().Known()) return false; - if (has_has_bottom().ValueOrDefault() && !has_bottom().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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; @@ -14507,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) && @@ -14540,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(), @@ -14673,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 { @@ -14709,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 @@ -14720,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); } @@ -14744,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 @@ -14755,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); } @@ -14779,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 @@ -14790,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); } @@ -14827,7 +14856,7 @@ struct EmbossReservedInternalIsGenericContainsBitsView< }; template -inline GenericContainsBitsView< +[[nodiscard]] inline GenericContainsBitsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -14842,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>( @@ -14851,7 +14880,7 @@ MakeContainsBitsView( T *emboss_reserved_local_data, } template -inline GenericContainsBitsView< +[[nodiscard]] inline GenericContainsBitsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedContainsBitsView( T *emboss_reserved_local_data, @@ -14917,48 +14946,50 @@ class GenericContainsContainsBitsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_condition().Known()) return false; - if (has_condition().ValueOrDefault() && !condition().Ok()) return false; - - - if (!has_top().Known()) return false; - if (has_top().ValueOrDefault() && !top().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) 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_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_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; @@ -14996,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) && @@ -15043,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(), @@ -15176,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 { @@ -15209,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()); @@ -15232,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))); @@ -15247,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); @@ -15255,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 { @@ -15272,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 @@ -15283,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); } @@ -15307,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 @@ -15318,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); } @@ -15355,7 +15386,7 @@ struct EmbossReservedInternalIsGenericContainsContainsBitsView< }; template -inline GenericContainsContainsBitsView< +[[nodiscard]] inline GenericContainsContainsBitsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -15370,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>( @@ -15379,7 +15410,7 @@ MakeContainsContainsBitsView( T *emboss_reserved_local_data, } template -inline GenericContainsContainsBitsView< +[[nodiscard]] inline GenericContainsContainsBitsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedContainsContainsBitsView( T *emboss_reserved_local_data, @@ -15452,53 +15483,42 @@ class GenericType0View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; - - - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; - - - if (!has_c().Known()) return false; - if (has_c().ValueOrDefault() && !c().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -15553,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) && @@ -15614,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(), @@ -15785,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 { @@ -15825,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 @@ -15836,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); } @@ -15860,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 @@ -15871,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); } @@ -15895,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 @@ -15906,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); } @@ -15943,7 +15963,7 @@ struct EmbossReservedInternalIsGenericType0View< }; template -inline GenericType0View< +[[nodiscard]] inline GenericType0View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -15958,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>( @@ -15967,7 +15987,7 @@ MakeType0View( T *emboss_reserved_local_data, } template -inline GenericType0View< +[[nodiscard]] inline GenericType0View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedType0View( T *emboss_reserved_local_data, @@ -16035,53 +16055,42 @@ class GenericType1View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; - - - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; - - - if (!has_c().Known()) return false; - if (has_c().ValueOrDefault() && !c().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -16136,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) && @@ -16197,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(), @@ -16368,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 { @@ -16408,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 @@ -16419,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); } @@ -16443,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 @@ -16454,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); } @@ -16478,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 @@ -16489,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); } @@ -16526,7 +16535,7 @@ struct EmbossReservedInternalIsGenericType1View< }; template -inline GenericType1View< +[[nodiscard]] inline GenericType1View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -16541,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>( @@ -16550,7 +16559,7 @@ MakeType1View( T *emboss_reserved_local_data, } template -inline GenericType1View< +[[nodiscard]] inline GenericType1View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedType1View( T *emboss_reserved_local_data, @@ -16611,52 +16620,53 @@ class GenericConditionalInlineView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_payload_id().Known()) return false; - if (has_payload_id().ValueOrDefault() && !payload_id().Ok()) return false; - - - if (!has_type_0().Known()) return false; - if (has_type_0().ValueOrDefault() && !type_0().Ok()) return false; - - - if (!has_type_1().Known()) return false; - if (has_type_1().ValueOrDefault() && !type_1().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; - - + 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_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_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; @@ -16711,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) && @@ -16772,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(), @@ -16943,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 { @@ -16982,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()); @@ -17005,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))); @@ -17022,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); @@ -17030,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 { @@ -17047,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 @@ -17058,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); } @@ -17082,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 @@ -17093,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); } @@ -17130,7 +17140,7 @@ struct EmbossReservedInternalIsGenericConditionalInlineView< }; template -inline GenericConditionalInlineView< +[[nodiscard]] inline GenericConditionalInlineView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -17145,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>( @@ -17154,7 +17164,7 @@ MakeConditionalInlineView( T *emboss_reserved_local_data, } template -inline GenericConditionalInlineView< +[[nodiscard]] inline GenericConditionalInlineView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConditionalInlineView( T *emboss_reserved_local_data, @@ -17229,53 +17239,52 @@ class GenericEmbossReservedAnonymousField2View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_low().Known()) return false; - if (has_low().ValueOrDefault() && !low().Ok()) return false; - - - if (!has_mid().Known()) return false; - if (has_mid().ValueOrDefault() && !mid().Ok()) return false; - - - if (!has_high().Known()) return false; - if (has_high().ValueOrDefault() && !high().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().Ok()) 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_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_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; @@ -17330,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) && @@ -17391,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(), @@ -17562,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 { @@ -17602,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 @@ -17613,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); } @@ -17637,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 @@ -17648,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); } @@ -17672,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 @@ -17683,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); } @@ -17720,7 +17729,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField2View< }; template -inline GenericEmbossReservedAnonymousField2View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField2View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -17735,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>( @@ -17744,7 +17753,7 @@ MakeEmbossReservedAnonymousField2View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField2View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField2View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField2View( T *emboss_reserved_local_data, @@ -17805,60 +17814,68 @@ class GenericConditionalAnonymousView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().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; - - - if (!has_low().Known()) return false; - if (has_low().ValueOrDefault() && !low().Ok()) return false; - - - if (!has_mid().Known()) return false; - if (has_mid().ValueOrDefault() && !mid().Ok()) return false; - - - if (!has_high().Known()) return false; - if (has_high().ValueOrDefault() && !high().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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_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_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; @@ -17896,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) && @@ -17943,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(), @@ -18152,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 { @@ -18206,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()); @@ -18229,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))); @@ -18244,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); @@ -18252,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 { @@ -18269,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 @@ -18280,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); } @@ -18304,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 @@ -18315,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); } @@ -18352,7 +18369,7 @@ struct EmbossReservedInternalIsGenericConditionalAnonymousView< }; template -inline GenericConditionalAnonymousView< +[[nodiscard]] inline GenericConditionalAnonymousView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -18367,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>( @@ -18376,7 +18393,7 @@ MakeConditionalAnonymousView( T *emboss_reserved_local_data, } template -inline GenericConditionalAnonymousView< +[[nodiscard]] inline GenericConditionalAnonymousView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConditionalAnonymousView( T *emboss_reserved_local_data, @@ -18447,45 +18464,40 @@ class GenericEmbossReservedAnonymousField1View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_enabled().Known()) return false; - if (has_enabled().ValueOrDefault() && !enabled().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -18506,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) && @@ -18539,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(), @@ -18634,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 { @@ -18658,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 @@ -18669,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); } @@ -18693,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 @@ -18704,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); } @@ -18728,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 @@ -18739,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); } @@ -18776,7 +18788,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField1View< }; template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -18791,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>( @@ -18800,7 +18812,7 @@ MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, @@ -18861,52 +18873,56 @@ class GenericConditionalOnFlagView final { - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_enabled().Known()) return false; - if (has_enabled().ValueOrDefault() && !enabled().Ok()) return false; - - - if (!has_value().Known()) return false; - if (has_value().ValueOrDefault() && !value().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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 = 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_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_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_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; @@ -18944,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) && @@ -18991,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(), @@ -19124,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 { @@ -19164,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()); @@ -19187,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))); @@ -19201,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); @@ -19209,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 { @@ -19226,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 @@ -19237,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); } @@ -19261,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 @@ -19272,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); } @@ -19309,7 +19325,7 @@ struct EmbossReservedInternalIsGenericConditionalOnFlagView< }; template -inline GenericConditionalOnFlagView< +[[nodiscard]] inline GenericConditionalOnFlagView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -19324,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>( @@ -19333,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 8c5f5b5..41ce2ea 100644 --- a/testdata/golden_cpp/dynamic_size.emb.h +++ b/testdata/golden_cpp/dynamic_size.emb.h @@ -171,60 +171,43 @@ class GenericMessageView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_header_length().Known()) return false; - if (has_header_length().ValueOrDefault() && !header_length().Ok()) return false; - - - if (!has_message_length().Known()) return false; - if (has_message_length().ValueOrDefault() && !message_length().Ok()) return false; - - - if (!has_padding().Known()) return false; - if (has_padding().ValueOrDefault() && !padding().Ok()) return false; - - - if (!has_message().Known()) return false; - if (has_message().ValueOrDefault() && !message().Ok()) return false; - - - if (!has_crc32().Known()) return false; - if (has_crc32().ValueOrDefault() && !crc32().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -313,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) && @@ -402,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(), @@ -649,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>> @@ -677,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>> @@ -689,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 { @@ -716,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()); @@ -739,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))); @@ -761,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); @@ -769,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 { @@ -786,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 @@ -797,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); } @@ -821,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 @@ -832,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); } @@ -869,7 +852,7 @@ struct EmbossReservedInternalIsGenericMessageView< }; template -inline GenericMessageView< +[[nodiscard]] inline GenericMessageView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -884,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>( @@ -893,7 +876,7 @@ MakeMessageView( T *emboss_reserved_local_data, } template -inline GenericMessageView< +[[nodiscard]] inline GenericMessageView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedMessageView( T *emboss_reserved_local_data, @@ -959,48 +942,40 @@ class GenericImageView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_size().Known()) return false; - if (has_size().ValueOrDefault() && !size().Ok()) return false; - - - if (!has_pixels().Known()) return false; - if (has_pixels().ValueOrDefault() && !pixels().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -1038,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) && @@ -1085,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(), @@ -1218,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< @@ -1246,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 { @@ -1265,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()); @@ -1288,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); @@ -1304,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); @@ -1312,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 { @@ -1329,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 @@ -1340,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); } @@ -1364,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 @@ -1375,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); } @@ -1412,7 +1387,7 @@ struct EmbossReservedInternalIsGenericImageView< }; template -inline GenericImageView< +[[nodiscard]] inline GenericImageView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1427,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>( @@ -1436,7 +1411,7 @@ MakeImageView( T *emboss_reserved_local_data, } template -inline GenericImageView< +[[nodiscard]] inline GenericImageView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedImageView( T *emboss_reserved_local_data, @@ -1506,64 +1481,44 @@ class GenericTwoRegionsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_b_end().Known()) return false; - if (has_b_end().ValueOrDefault() && !b_end().Ok()) return false; - - - if (!has_b_start().Known()) return false; - if (has_b_start().ValueOrDefault() && !b_start().Ok()) return false; - - - if (!has_a_size().Known()) return false; - if (has_a_size().ValueOrDefault() && !a_size().Ok()) return false; - - - if (!has_a_start().Known()) return false; - if (has_a_start().ValueOrDefault() && !a_start().Ok()) return false; - - - if (!has_region_a().Known()) return false; - if (has_region_a().ValueOrDefault() && !region_a().Ok()) return false; - - - if (!has_region_b().Known()) return false; - if (has_region_b().ValueOrDefault() && !region_b().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -1669,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) && @@ -1772,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(), @@ -2057,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>> @@ -2101,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>> @@ -2113,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 { @@ -2132,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()); @@ -2155,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(); @@ -2179,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); @@ -2187,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 { @@ -2204,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 @@ -2215,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); } @@ -2239,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 @@ -2250,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); } @@ -2287,7 +2242,7 @@ struct EmbossReservedInternalIsGenericTwoRegionsView< }; template -inline GenericTwoRegionsView< +[[nodiscard]] inline GenericTwoRegionsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2302,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>( @@ -2311,7 +2266,7 @@ MakeTwoRegionsView( T *emboss_reserved_local_data, } template -inline GenericTwoRegionsView< +[[nodiscard]] inline GenericTwoRegionsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedTwoRegionsView( T *emboss_reserved_local_data, @@ -2378,52 +2333,41 @@ class GenericMultipliedSizeView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_width().Known()) return false; - if (has_width().ValueOrDefault() && !width().Ok()) return false; - - - if (!has_height().Known()) return false; - if (has_height().ValueOrDefault() && !height().Ok()) return false; - - - if (!has_data().Known()) return false; - if (has_data().ValueOrDefault() && !data().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -2478,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) && @@ -2539,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(), @@ -2710,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>> @@ -2738,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 { @@ -2757,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()); @@ -2780,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(); @@ -2798,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); @@ -2806,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 { @@ -2823,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 @@ -2834,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); } @@ -2858,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 @@ -2869,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); } @@ -2906,7 +2850,7 @@ struct EmbossReservedInternalIsGenericMultipliedSizeView< }; template -inline GenericMultipliedSizeView< +[[nodiscard]] inline GenericMultipliedSizeView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2921,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>( @@ -2930,7 +2874,7 @@ MakeMultipliedSizeView( T *emboss_reserved_local_data, } template -inline GenericMultipliedSizeView< +[[nodiscard]] inline GenericMultipliedSizeView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedMultipliedSizeView( T *emboss_reserved_local_data, @@ -3003,76 +2947,47 @@ class GenericNegativeTermsInSizesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; - - - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; - - - if (!has_c().Known()) return false; - if (has_c().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; - - - if (!has_a_minus_2b().Known()) return false; - if (has_a_minus_2b().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; - - - if (!has_ten_minus_a().Known()) return false; - if (has_ten_minus_a().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; - - - if (!has_a_minus_c().Known()) return false; - if (has_a_minus_c().ValueOrDefault() && !a_minus_c().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -3229,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) && @@ -3374,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(), @@ -3773,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>> @@ -3809,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>> @@ -3821,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>> @@ -3833,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>> @@ -3845,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>> @@ -3857,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>> @@ -3869,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 { @@ -3888,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()); @@ -3911,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(); @@ -3953,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); @@ -3961,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 { @@ -3978,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 @@ -3989,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); } @@ -4013,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 @@ -4024,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); } @@ -4061,7 +3976,7 @@ struct EmbossReservedInternalIsGenericNegativeTermsInSizesView< }; template -inline GenericNegativeTermsInSizesView< +[[nodiscard]] inline GenericNegativeTermsInSizesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4076,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>( @@ -4085,7 +4000,7 @@ MakeNegativeTermsInSizesView( T *emboss_reserved_local_data, } template -inline GenericNegativeTermsInSizesView< +[[nodiscard]] inline GenericNegativeTermsInSizesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedNegativeTermsInSizesView( T *emboss_reserved_local_data, @@ -4151,48 +4066,40 @@ class GenericNegativeTermInLocationView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; - - - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -4230,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) && @@ -4277,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(), @@ -4410,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 { @@ -4445,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()); @@ -4468,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); @@ -4484,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); @@ -4492,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 { @@ -4509,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 @@ -4520,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); } @@ -4544,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 @@ -4555,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); } @@ -4592,7 +4499,7 @@ struct EmbossReservedInternalIsGenericNegativeTermInLocationView< }; template -inline GenericNegativeTermInLocationView< +[[nodiscard]] inline GenericNegativeTermInLocationView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4607,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>( @@ -4616,7 +4523,7 @@ MakeNegativeTermInLocationView( T *emboss_reserved_local_data, } template -inline GenericNegativeTermInLocationView< +[[nodiscard]] inline GenericNegativeTermInLocationView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedNegativeTermInLocationView( T *emboss_reserved_local_data, @@ -4684,56 +4591,42 @@ class GenericChainedSizeView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; - - - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; - - - if (!has_c().Known()) return false; - if (has_c().ValueOrDefault() && !c().Ok()) return false; - - - if (!has_d().Known()) return false; - if (has_d().ValueOrDefault() && !d().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -4805,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) && @@ -4880,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(), @@ -5089,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 { @@ -5140,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()); @@ -5163,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))); @@ -5186,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); @@ -5194,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 { @@ -5211,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 @@ -5222,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); } @@ -5246,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 @@ -5257,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); } @@ -5294,7 +5187,7 @@ struct EmbossReservedInternalIsGenericChainedSizeView< }; template -inline GenericChainedSizeView< +[[nodiscard]] inline GenericChainedSizeView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5309,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>( @@ -5318,7 +5211,7 @@ MakeChainedSizeView( T *emboss_reserved_local_data, } template -inline GenericChainedSizeView< +[[nodiscard]] inline GenericChainedSizeView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedChainedSizeView( T *emboss_reserved_local_data, @@ -5385,53 +5278,42 @@ class GenericFinalFieldOverlapsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; - - - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; - - - if (!has_c().Known()) return false; - if (has_c().ValueOrDefault() && !c().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -5486,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) && @@ -5547,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(), @@ -5718,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 { @@ -5758,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 @@ -5769,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); } @@ -5793,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 @@ -5804,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); } @@ -5828,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 @@ -5839,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); } @@ -5876,7 +5758,7 @@ struct EmbossReservedInternalIsGenericFinalFieldOverlapsView< }; template -inline GenericFinalFieldOverlapsView< +[[nodiscard]] inline GenericFinalFieldOverlapsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5891,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>( @@ -5900,7 +5782,7 @@ MakeFinalFieldOverlapsView( T *emboss_reserved_local_data, } template -inline GenericFinalFieldOverlapsView< +[[nodiscard]] inline GenericFinalFieldOverlapsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedFinalFieldOverlapsView( T *emboss_reserved_local_data, @@ -5968,56 +5850,42 @@ class GenericDynamicFinalFieldOverlapsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; - - - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; - - - if (!has_c().Known()) return false; - if (has_c().ValueOrDefault() && !c().Ok()) return false; - - - if (!has_d().Known()) return false; - if (has_d().ValueOrDefault() && !d().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -6089,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) && @@ -6164,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(), @@ -6373,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 { @@ -6424,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()); @@ -6447,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))); @@ -6465,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); @@ -6473,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 { @@ -6490,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 @@ -6501,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); } @@ -6525,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 @@ -6536,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); } @@ -6573,7 +6441,7 @@ struct EmbossReservedInternalIsGenericDynamicFinalFieldOverlapsView< }; template -inline GenericDynamicFinalFieldOverlapsView< +[[nodiscard]] inline GenericDynamicFinalFieldOverlapsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -6588,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>( @@ -6597,7 +6465,7 @@ MakeDynamicFinalFieldOverlapsView( T *emboss_reserved_local_data, } template -inline GenericDynamicFinalFieldOverlapsView< +[[nodiscard]] inline GenericDynamicFinalFieldOverlapsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedDynamicFinalFieldOverlapsView( T *emboss_reserved_local_data, @@ -6663,48 +6531,40 @@ class GenericDynamicFieldDependsOnLaterFieldView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; - - - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -6742,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) && @@ -6789,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(), @@ -6922,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 { @@ -6957,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()); @@ -6980,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))); @@ -6996,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); @@ -7004,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 { @@ -7021,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 @@ -7032,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); } @@ -7056,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 @@ -7067,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); } @@ -7104,7 +6964,7 @@ struct EmbossReservedInternalIsGenericDynamicFieldDependsOnLaterFieldView< }; template -inline GenericDynamicFieldDependsOnLaterFieldView< +[[nodiscard]] inline GenericDynamicFieldDependsOnLaterFieldView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -7119,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>( @@ -7128,7 +6988,7 @@ MakeDynamicFieldDependsOnLaterFieldView( T *emboss_reserved_local_data, } template -inline GenericDynamicFieldDependsOnLaterFieldView< +[[nodiscard]] inline GenericDynamicFieldDependsOnLaterFieldView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedDynamicFieldDependsOnLaterFieldView( T *emboss_reserved_local_data, @@ -7195,53 +7055,42 @@ class GenericDynamicFieldDoesNotAffectSizeView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; - - - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; - - - if (!has_c().Known()) return false; - if (has_c().ValueOrDefault() && !c().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -7296,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) && @@ -7357,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(), @@ -7528,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 { @@ -7568,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 @@ -7579,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); } @@ -7603,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 @@ -7614,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); } @@ -7638,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 @@ -7649,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); } @@ -7686,7 +7535,7 @@ struct EmbossReservedInternalIsGenericDynamicFieldDoesNotAffectSizeView< }; template -inline GenericDynamicFieldDoesNotAffectSizeView< +[[nodiscard]] inline GenericDynamicFieldDoesNotAffectSizeView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -7701,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>( @@ -7710,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 f056862..ddd45bf 100644 --- a/testdata/golden_cpp/enum.emb.h +++ b/testdata/golden_cpp/enum.emb.h @@ -136,54 +136,46 @@ class GenericConstantsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_sprocket().Known()) return false; - if (has_sprocket().ValueOrDefault() && !sprocket().Ok()) return false; - - - if (!has_geegaw().Known()) return false; - if (has_geegaw().ValueOrDefault() && !geegaw().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; } @@ -203,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(), @@ -299,7 +291,7 @@ class GenericConstantsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: class EmbossReservedVirtualSprocketView final { @@ -315,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 @@ -326,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); } @@ -350,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 @@ -361,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); } @@ -385,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 @@ -396,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); } @@ -420,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 @@ -431,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); } @@ -455,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 @@ -466,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); } @@ -503,7 +495,7 @@ struct EmbossReservedInternalIsGenericConstantsView< }; template -inline GenericConstantsView< +[[nodiscard]] inline GenericConstantsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -518,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>( @@ -527,7 +519,7 @@ MakeConstantsView( T *emboss_reserved_local_data, } template -inline GenericConstantsView< +[[nodiscard]] inline GenericConstantsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConstantsView( T *emboss_reserved_local_data, @@ -1543,45 +1535,40 @@ class GenericEmbossReservedAnonymousField1View final { - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -1602,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) && @@ -1635,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(), @@ -1730,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 { @@ -1755,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 @@ -1766,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); } @@ -1790,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 @@ -1801,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); } @@ -1825,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 @@ -1836,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); } @@ -1873,7 +1860,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField1View< }; template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1888,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>( @@ -1897,7 +1884,7 @@ MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, @@ -1958,61 +1945,51 @@ class GenericManifestEntryView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_kind().Known()) return false; - if (has_kind().ValueOrDefault() && !kind().Ok()) return false; - - - if (!has_count().Known()) return false; - if (has_count().ValueOrDefault() && !count().Ok()) return false; - - - if (!has_wide_kind().Known()) return false; - if (has_wide_kind().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; - - - if (!has_wide_kind_in_bits().Known()) return false; - if (has_wide_kind_in_bits().ValueOrDefault() && !wide_kind_in_bits().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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; @@ -2084,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) && @@ -2159,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(), @@ -2368,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 { @@ -2423,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 @@ -2434,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); } @@ -2458,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 @@ -2469,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); } @@ -2493,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 @@ -2504,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); } @@ -2541,7 +2518,7 @@ struct EmbossReservedInternalIsGenericManifestEntryView< }; template -inline GenericManifestEntryView< +[[nodiscard]] inline GenericManifestEntryView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2556,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>( @@ -2565,7 +2542,7 @@ MakeManifestEntryView( T *emboss_reserved_local_data, } template -inline GenericManifestEntryView< +[[nodiscard]] inline GenericManifestEntryView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedManifestEntryView( T *emboss_reserved_local_data, @@ -2717,45 +2694,40 @@ class GenericStructContainingEnumView final { using Status = ::emboss::test::StructContainingEnum::Status; - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_bar().Known()) return false; - if (has_bar().ValueOrDefault() && !bar().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -2776,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) && @@ -2809,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(), @@ -2904,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 { @@ -2928,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 @@ -2939,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); } @@ -2963,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 @@ -2974,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); } @@ -2998,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 @@ -3009,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); } @@ -3046,7 +3018,7 @@ struct EmbossReservedInternalIsGenericStructContainingEnumView< }; template -inline GenericStructContainingEnumView< +[[nodiscard]] inline GenericStructContainingEnumView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3061,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>( @@ -3070,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 5738596..6ef116a 100644 --- a/testdata/golden_cpp/enum_case.emb.h +++ b/testdata/golden_cpp/enum_case.emb.h @@ -331,53 +331,42 @@ class GenericUseKCamelEnumCaseView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_v().Known()) return false; - if (has_v().ValueOrDefault() && !v().Ok()) return false; - - - if (!has_first().Known()) return false; - if (has_first().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; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -398,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) && @@ -431,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(), @@ -564,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 { @@ -589,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 @@ -600,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); } @@ -627,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()); @@ -650,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))); @@ -663,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); @@ -671,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 { @@ -688,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 @@ -699,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); } @@ -723,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 @@ -734,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); } @@ -758,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 @@ -769,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); } @@ -806,7 +795,7 @@ struct EmbossReservedInternalIsGenericUseKCamelEnumCaseView< }; template -inline GenericUseKCamelEnumCaseView< +[[nodiscard]] inline GenericUseKCamelEnumCaseView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -821,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>( @@ -830,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 f8fd46f..566dcf7 100644 --- a/testdata/golden_cpp/explicit_sizes.emb.h +++ b/testdata/golden_cpp/explicit_sizes.emb.h @@ -115,53 +115,42 @@ class GenericSizedUIntArraysView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_one_nibble().Known()) return false; - if (has_one_nibble().ValueOrDefault() && !one_nibble().Ok()) return false; - - - if (!has_two_nibble().Known()) return false; - if (has_two_nibble().ValueOrDefault() && !two_nibble().Ok()) return false; - - - if (!has_four_nibble().Known()) return false; - if (has_four_nibble().ValueOrDefault() && !four_nibble().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -216,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) && @@ -277,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(), @@ -448,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> @@ -460,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> @@ -472,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> @@ -484,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 { @@ -500,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 @@ -511,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); } @@ -535,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 @@ -546,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); } @@ -570,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 @@ -581,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); } @@ -618,7 +607,7 @@ struct EmbossReservedInternalIsGenericSizedUIntArraysView< }; template -inline GenericSizedUIntArraysView< +[[nodiscard]] inline GenericSizedUIntArraysView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -633,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>( @@ -642,7 +631,7 @@ MakeSizedUIntArraysView( T *emboss_reserved_local_data, } template -inline GenericSizedUIntArraysView< +[[nodiscard]] inline GenericSizedUIntArraysView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedSizedUIntArraysView( T *emboss_reserved_local_data, @@ -709,53 +698,42 @@ class GenericSizedIntArraysView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_one_nibble().Known()) return false; - if (has_one_nibble().ValueOrDefault() && !one_nibble().Ok()) return false; - - - if (!has_two_nibble().Known()) return false; - if (has_two_nibble().ValueOrDefault() && !two_nibble().Ok()) return false; - - - if (!has_four_nibble().Known()) return false; - if (has_four_nibble().ValueOrDefault() && !four_nibble().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -810,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) && @@ -871,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(), @@ -1042,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> @@ -1054,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> @@ -1066,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> @@ -1078,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 { @@ -1094,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 @@ -1105,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); } @@ -1129,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 @@ -1140,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); } @@ -1164,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 @@ -1175,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); } @@ -1212,7 +1190,7 @@ struct EmbossReservedInternalIsGenericSizedIntArraysView< }; template -inline GenericSizedIntArraysView< +[[nodiscard]] inline GenericSizedIntArraysView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1227,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>( @@ -1236,7 +1214,7 @@ MakeSizedIntArraysView( T *emboss_reserved_local_data, } template -inline GenericSizedIntArraysView< +[[nodiscard]] inline GenericSizedIntArraysView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedSizedIntArraysView( T *emboss_reserved_local_data, @@ -1303,53 +1281,42 @@ class GenericSizedEnumArraysView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_one_nibble().Known()) return false; - if (has_one_nibble().ValueOrDefault() && !one_nibble().Ok()) return false; - - - if (!has_two_nibble().Known()) return false; - if (has_two_nibble().ValueOrDefault() && !two_nibble().Ok()) return false; - - - if (!has_four_nibble().Known()) return false; - if (has_four_nibble().ValueOrDefault() && !four_nibble().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -1404,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) && @@ -1465,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(), @@ -1636,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>, @@ -1649,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>, @@ -1662,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>, @@ -1675,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 { @@ -1691,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 @@ -1702,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); } @@ -1726,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 @@ -1737,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); } @@ -1761,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 @@ -1772,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); } @@ -1809,7 +1776,7 @@ struct EmbossReservedInternalIsGenericSizedEnumArraysView< }; template -inline GenericSizedEnumArraysView< +[[nodiscard]] inline GenericSizedEnumArraysView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1824,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>( @@ -1833,7 +1800,7 @@ MakeSizedEnumArraysView( T *emboss_reserved_local_data, } template -inline GenericSizedEnumArraysView< +[[nodiscard]] inline GenericSizedEnumArraysView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedSizedEnumArraysView( T *emboss_reserved_local_data, @@ -1898,45 +1865,40 @@ class GenericBitArrayContainerView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_uint_arrays().Known()) return false; - if (has_uint_arrays().ValueOrDefault() && !uint_arrays().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -1957,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) && @@ -1990,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(), @@ -2085,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 { @@ -2107,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 @@ -2118,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); } @@ -2142,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 @@ -2153,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); } @@ -2177,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 @@ -2188,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); } @@ -2225,7 +2187,7 @@ struct EmbossReservedInternalIsGenericBitArrayContainerView< }; template -inline GenericBitArrayContainerView< +[[nodiscard]] inline GenericBitArrayContainerView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2240,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>( @@ -2249,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 d43d32e..1e5e869 100644 --- a/testdata/golden_cpp/float.emb.h +++ b/testdata/golden_cpp/float.emb.h @@ -96,49 +96,41 @@ class GenericFloatsView final { - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_float_big_endian().Known()) return false; - if (has_float_big_endian().ValueOrDefault() && !float_big_endian().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -176,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) && @@ -223,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(), @@ -356,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 { @@ -388,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 @@ -399,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); } @@ -423,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 @@ -434,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); } @@ -458,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 @@ -469,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); } @@ -506,7 +498,7 @@ struct EmbossReservedInternalIsGenericFloatsView< }; template -inline GenericFloatsView< +[[nodiscard]] inline GenericFloatsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -521,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>( @@ -530,7 +522,7 @@ MakeFloatsView( T *emboss_reserved_local_data, } template -inline GenericFloatsView< +[[nodiscard]] inline GenericFloatsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedFloatsView( T *emboss_reserved_local_data, @@ -596,49 +588,41 @@ class GenericDoublesView final { - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_double_big_endian().Known()) return false; - if (has_double_big_endian().ValueOrDefault() && !double_big_endian().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -676,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) && @@ -723,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(), @@ -856,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 { @@ -888,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 @@ -899,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); } @@ -923,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 @@ -934,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); } @@ -958,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 @@ -969,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); } @@ -1006,7 +990,7 @@ struct EmbossReservedInternalIsGenericDoublesView< }; template -inline GenericDoublesView< +[[nodiscard]] inline GenericDoublesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1021,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>( @@ -1030,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 2217543..840712a 100644 --- a/testdata/golden_cpp/imported.emb.h +++ b/testdata/golden_cpp/imported.emb.h @@ -87,45 +87,40 @@ class GenericInnerView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_value().Known()) return false; - if (has_value().ValueOrDefault() && !value().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -146,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) && @@ -179,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(), @@ -274,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 { @@ -298,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 @@ -309,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); } @@ -333,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 @@ -344,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); } @@ -368,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 @@ -379,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); } @@ -416,7 +411,7 @@ struct EmbossReservedInternalIsGenericInnerView< }; template -inline GenericInnerView< +[[nodiscard]] inline GenericInnerView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -431,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>( @@ -440,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 af1ef31..cc5384f 100644 --- a/testdata/golden_cpp/imported_genfiles.emb.h +++ b/testdata/golden_cpp/imported_genfiles.emb.h @@ -88,45 +88,40 @@ class GenericInnerView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_value().Known()) return false; - if (has_value().ValueOrDefault() && !value().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -147,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) && @@ -180,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(), @@ -275,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 { @@ -299,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 @@ -310,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); } @@ -334,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 @@ -345,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); } @@ -369,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 @@ -380,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); } @@ -417,7 +412,7 @@ struct EmbossReservedInternalIsGenericInnerView< }; template -inline GenericInnerView< +[[nodiscard]] inline GenericInnerView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -432,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>( @@ -441,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 75ad2d2..f209c6c 100644 --- a/testdata/golden_cpp/importer.emb.h +++ b/testdata/golden_cpp/importer.emb.h @@ -92,49 +92,41 @@ class GenericOuterView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_inner().Known()) return false; - if (has_inner().ValueOrDefault() && !inner().Ok()) return false; - - - if (!has_inner_gen().Known()) return false; - if (has_inner_gen().ValueOrDefault() && !inner_gen().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -172,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) && @@ -219,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(), @@ -352,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 { @@ -380,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 @@ -391,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); } @@ -415,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 @@ -426,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); } @@ -450,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 @@ -461,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); } @@ -498,7 +490,7 @@ struct EmbossReservedInternalIsGenericOuterView< }; template -inline GenericOuterView< +[[nodiscard]] inline GenericOuterView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -513,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>( @@ -522,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 ca22c93..b4107d1 100644 --- a/testdata/golden_cpp/importer2.emb.h +++ b/testdata/golden_cpp/importer2.emb.h @@ -89,45 +89,40 @@ class GenericOuter2View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_outer().Known()) return false; - if (has_outer().ValueOrDefault() && !outer().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -148,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) && @@ -181,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(), @@ -276,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 { @@ -298,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 @@ -309,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); } @@ -333,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 @@ -344,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); } @@ -368,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 @@ -379,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); } @@ -416,7 +411,7 @@ struct EmbossReservedInternalIsGenericOuter2View< }; template -inline GenericOuter2View< +[[nodiscard]] inline GenericOuter2View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -431,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>( @@ -440,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 8f89827..f55d002 100644 --- a/testdata/golden_cpp/inline_type.emb.h +++ b/testdata/golden_cpp/inline_type.emb.h @@ -269,49 +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; - if (!has_status().Known()) return false; - if (has_status().ValueOrDefault() && !status().Ok()) return false; - - - if (!has_secondary_status().Known()) return false; - if (has_secondary_status().ValueOrDefault() && !secondary_status().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -349,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) && @@ -396,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(), @@ -529,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 { @@ -563,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 @@ -574,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); } @@ -598,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 @@ -609,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); } @@ -633,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 @@ -644,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); } @@ -681,7 +673,7 @@ struct EmbossReservedInternalIsGenericFooView< }; template -inline GenericFooView< +[[nodiscard]] inline GenericFooView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -696,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>( @@ -705,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 fe697e9..956706f 100644 --- a/testdata/golden_cpp/int_sizes.emb.h +++ b/testdata/golden_cpp/int_sizes.emb.h @@ -94,73 +94,47 @@ class GenericSizesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; - - - if (!has_two_byte().Known()) return false; - if (has_two_byte().ValueOrDefault() && !two_byte().Ok()) return false; - - - if (!has_three_byte().Known()) return false; - if (has_three_byte().ValueOrDefault() && !three_byte().Ok()) return false; - - - if (!has_four_byte().Known()) return false; - if (has_four_byte().ValueOrDefault() && !four_byte().Ok()) return false; - - - if (!has_five_byte().Known()) return false; - if (has_five_byte().ValueOrDefault() && !five_byte().Ok()) return false; - - - if (!has_six_byte().Known()) return false; - if (has_six_byte().ValueOrDefault() && !six_byte().Ok()) return false; - - - if (!has_seven_byte().Known()) return false; - if (has_seven_byte().ValueOrDefault() && !seven_byte().Ok()) return false; - - - if (!has_eight_byte().Known()) return false; - if (has_eight_byte().ValueOrDefault() && !eight_byte().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -300,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) && @@ -431,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(), @@ -792,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 { @@ -872,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 @@ -883,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); } @@ -907,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 @@ -918,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); } @@ -942,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 @@ -953,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); } @@ -990,7 +964,7 @@ struct EmbossReservedInternalIsGenericSizesView< }; template -inline GenericSizesView< +[[nodiscard]] inline GenericSizesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1005,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>( @@ -1014,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 47b4511..9985afe 100644 --- a/testdata/golden_cpp/large_array.emb.h +++ b/testdata/golden_cpp/large_array.emb.h @@ -88,48 +88,40 @@ class GenericUIntArrayView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_element_count().Known()) return false; - if (has_element_count().ValueOrDefault() && !element_count().Ok()) return false; - - - if (!has_elements().Known()) return false; - if (has_elements().ValueOrDefault() && !elements().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -167,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) && @@ -214,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(), @@ -347,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>> @@ -367,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 { @@ -386,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()); @@ -409,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); @@ -425,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); @@ -433,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 { @@ -450,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 @@ -461,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); } @@ -485,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 @@ -496,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); } @@ -533,7 +525,7 @@ struct EmbossReservedInternalIsGenericUIntArrayView< }; template -inline GenericUIntArrayView< +[[nodiscard]] inline GenericUIntArrayView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -548,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>( @@ -557,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 b953e31..2b37ffd 100644 --- a/testdata/golden_cpp/nested_structure.emb.h +++ b/testdata/golden_cpp/nested_structure.emb.h @@ -105,53 +105,42 @@ class GenericContainerView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_weight().Known()) return false; - if (has_weight().ValueOrDefault() && !weight().Ok()) return false; - - - if (!has_important_box().Known()) return false; - if (has_important_box().ValueOrDefault() && !important_box().Ok()) return false; - - - if (!has_other_box().Known()) return false; - if (has_other_box().ValueOrDefault() && !other_box().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -206,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) && @@ -267,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(), @@ -438,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 { @@ -474,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 @@ -485,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); } @@ -509,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 @@ -520,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); } @@ -544,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 @@ -555,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); } @@ -592,7 +581,7 @@ struct EmbossReservedInternalIsGenericContainerView< }; template -inline GenericContainerView< +[[nodiscard]] inline GenericContainerView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -607,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>( @@ -616,7 +605,7 @@ MakeContainerView( T *emboss_reserved_local_data, } template -inline GenericContainerView< +[[nodiscard]] inline GenericContainerView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedContainerView( T *emboss_reserved_local_data, @@ -682,49 +671,41 @@ class GenericBoxView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_id().Known()) return false; - if (has_id().ValueOrDefault() && !id().Ok()) return false; - - - if (!has_count().Known()) return false; - if (has_count().ValueOrDefault() && !count().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -762,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) && @@ -809,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(), @@ -942,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 { @@ -974,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 @@ -985,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); } @@ -1009,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 @@ -1020,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); } @@ -1044,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 @@ -1055,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); } @@ -1092,7 +1073,7 @@ struct EmbossReservedInternalIsGenericBoxView< }; template -inline GenericBoxView< +[[nodiscard]] inline GenericBoxView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1107,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>( @@ -1116,7 +1097,7 @@ MakeBoxView( T *emboss_reserved_local_data, } template -inline GenericBoxView< +[[nodiscard]] inline GenericBoxView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedBoxView( T *emboss_reserved_local_data, @@ -1182,49 +1163,41 @@ class GenericTruckView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_id().Known()) return false; - if (has_id().ValueOrDefault() && !id().Ok()) return false; - - - if (!has_cargo().Known()) return false; - if (has_cargo().ValueOrDefault() && !cargo().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -1262,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) && @@ -1309,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(), @@ -1442,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 { @@ -1476,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 @@ -1487,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); } @@ -1511,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 @@ -1522,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); } @@ -1546,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 @@ -1557,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); } @@ -1594,7 +1567,7 @@ struct EmbossReservedInternalIsGenericTruckView< }; template -inline GenericTruckView< +[[nodiscard]] inline GenericTruckView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1609,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>( @@ -1618,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 624c954..a6988e3 100644 --- a/testdata/golden_cpp/next_keyword.emb.h +++ b/testdata/golden_cpp/next_keyword.emb.h @@ -90,57 +90,43 @@ class GenericNextKeywordView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_value32().Known()) return false; - if (has_value32().ValueOrDefault() && !value32().Ok()) return false; - - - if (!has_value16().Known()) return false; - if (has_value16().ValueOrDefault() && !value16().Ok()) return false; - - - if (!has_value8().Known()) return false; - if (has_value8().ValueOrDefault() && !value8().Ok()) return false; - - - if (!has_value8_offset().Known()) return false; - if (has_value8_offset().ValueOrDefault() && !value8_offset().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -212,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) && @@ -287,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(), @@ -496,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 { @@ -544,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 @@ -555,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); } @@ -579,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 @@ -590,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); } @@ -614,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 @@ -625,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); } @@ -662,7 +648,7 @@ struct EmbossReservedInternalIsGenericNextKeywordView< }; template -inline GenericNextKeywordView< +[[nodiscard]] inline GenericNextKeywordView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -677,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>( @@ -686,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 5f97e05..0c3b29f 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); -} @@ -166,45 +89,40 @@ class GenericBarView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_foo().Known()) return false; - if (has_foo().ValueOrDefault() && !foo().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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 (!foo().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( GenericBarView emboss_reserved_local_other) const { if (!has_foo().Known()) return false; @@ -225,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) && @@ -258,111 +176,25 @@ 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(), 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; } + [[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 { @@ -378,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 @@ -389,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); } @@ -413,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 @@ -424,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); } @@ -448,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 @@ -459,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); } @@ -496,7 +328,7 @@ struct EmbossReservedInternalIsGenericBarView< }; template -inline GenericBarView< +[[nodiscard]] inline GenericBarView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -511,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>( @@ -520,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 d60f164..03e4169 100644 --- a/testdata/golden_cpp/parameters.emb.h +++ b/testdata/golden_cpp/parameters.emb.h @@ -385,56 +385,65 @@ class GenericMultiVersionView final { - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_axes().Known()) return false; - if (has_axes().ValueOrDefault() && !axes().Ok()) return false; - - - if (!has_config().Known()) return false; - if (has_config().ValueOrDefault() && !config().Ok()) return false; - - - if (!has_config_vx().Known()) return false; - if (has_config_vx().ValueOrDefault() && !config_vx().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; - - + 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_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_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_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; @@ -523,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) && @@ -612,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(), @@ -821,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 { @@ -879,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()); @@ -902,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))); @@ -924,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); @@ -932,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 { @@ -949,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 @@ -960,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); } @@ -984,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 @@ -995,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); } @@ -1032,7 +1041,7 @@ struct EmbossReservedInternalIsGenericMultiVersionView< }; template -inline GenericMultiVersionView< +[[nodiscard]] inline GenericMultiVersionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1047,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>( @@ -1056,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, @@ -1126,60 +1135,66 @@ class GenericAxesView final { - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; - - - if (!has_z().Known()) return false; - if (has_z().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; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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_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_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; @@ -1268,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) && @@ -1357,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(), @@ -1585,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 { @@ -1644,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()); @@ -1667,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))); @@ -1680,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); @@ -1688,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 { @@ -1708,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()); @@ -1731,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))); @@ -1753,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); @@ -1761,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 { @@ -1778,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 @@ -1789,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); } @@ -1813,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 @@ -1824,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); } @@ -1861,7 +1876,7 @@ struct EmbossReservedInternalIsGenericAxesView< }; template -inline GenericAxesView< +[[nodiscard]] inline GenericAxesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1876,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>( @@ -1885,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, @@ -1958,57 +1973,43 @@ class GenericAxisPairView final { - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_axis_a().Known()) return false; - if (has_axis_a().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; - - - if (!has_axis_b().Known()) return false; - if (has_axis_b().ValueOrDefault() && !axis_b().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -2080,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) && @@ -2155,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(), @@ -2326,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_); } @@ -2369,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()); @@ -2392,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); @@ -2412,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 { @@ -2438,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()); @@ -2461,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); @@ -2481,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 { @@ -2504,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 @@ -2515,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); } @@ -2539,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 @@ -2550,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); } @@ -2574,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 @@ -2585,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); } @@ -2623,7 +2624,7 @@ struct EmbossReservedInternalIsGenericAxisPairView< }; template -inline GenericAxisPairView< +[[nodiscard]] inline GenericAxisPairView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2638,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>( @@ -2647,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, @@ -2713,48 +2714,40 @@ class GenericAxesEnvelopeView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_axis_count().Known()) return false; - if (has_axis_count().ValueOrDefault() && !axis_count().Ok()) return false; - - - if (!has_axes().Known()) return false; - if (has_axes().ValueOrDefault() && !axes().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -2792,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) && @@ -2839,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(), @@ -2972,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 { @@ -3005,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()); @@ -3028,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))); @@ -3044,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); @@ -3052,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 { @@ -3069,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 @@ -3080,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); } @@ -3104,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 @@ -3115,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); } @@ -3152,7 +3145,7 @@ struct EmbossReservedInternalIsGenericAxesEnvelopeView< }; template -inline GenericAxesEnvelopeView< +[[nodiscard]] inline GenericAxesEnvelopeView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3167,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>( @@ -3176,7 +3169,7 @@ MakeAxesEnvelopeView( T *emboss_reserved_local_data, } template -inline GenericAxesEnvelopeView< +[[nodiscard]] inline GenericAxesEnvelopeView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedAxesEnvelopeView( T *emboss_reserved_local_data, @@ -3353,61 +3346,58 @@ class GenericAxisView final { - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_axis_type().Known()) return false; - if (has_axis_type().ValueOrDefault() && !axis_type().Ok()) return false; - - - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; - - - if (!has_z().Known()) return false; - if (has_z().ValueOrDefault() && !z().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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; @@ -3496,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) && @@ -3585,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(), @@ -3813,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 { @@ -3852,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()); @@ -3875,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); @@ -3895,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 { @@ -3936,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 @@ -3947,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); } @@ -3971,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 @@ -3982,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); } @@ -4006,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 @@ -4017,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); } @@ -4054,7 +4044,7 @@ struct EmbossReservedInternalIsGenericAxisView< }; template -inline GenericAxisView< +[[nodiscard]] inline GenericAxisView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4069,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>( @@ -4078,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, @@ -4143,45 +4133,40 @@ class GenericConfigView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_power().Known()) return false; - if (has_power().ValueOrDefault() && !power().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -4202,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) && @@ -4235,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(), @@ -4330,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 { @@ -4354,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 @@ -4365,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); } @@ -4389,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 @@ -4400,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); } @@ -4424,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 @@ -4435,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); } @@ -4472,7 +4457,7 @@ struct EmbossReservedInternalIsGenericConfigView< }; template -inline GenericConfigView< +[[nodiscard]] inline GenericConfigView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4487,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>( @@ -4496,7 +4481,7 @@ MakeConfigView( T *emboss_reserved_local_data, } template -inline GenericConfigView< +[[nodiscard]] inline GenericConfigView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConfigView( T *emboss_reserved_local_data, @@ -4567,45 +4552,40 @@ class GenericEmbossReservedAnonymousField1View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_power().Known()) return false; - if (has_power().ValueOrDefault() && !power().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -4626,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) && @@ -4659,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(), @@ -4754,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 { @@ -4778,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 @@ -4789,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); } @@ -4813,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 @@ -4824,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); } @@ -4848,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 @@ -4859,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); } @@ -4896,7 +4876,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField1View< }; template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4911,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>( @@ -4920,7 +4900,7 @@ MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, @@ -4981,53 +4961,49 @@ class GenericConfigVXView final { - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_power().Known()) return false; - if (has_power().ValueOrDefault() && !power().Ok()) return false; - - - if (!has_gain().Known()) return false; - if (has_gain().ValueOrDefault() && !gain().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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; @@ -5065,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) && @@ -5112,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(), @@ -5245,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 { @@ -5282,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 @@ -5293,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); } @@ -5317,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 @@ -5328,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); } @@ -5352,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 @@ -5363,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); } @@ -5400,7 +5376,7 @@ struct EmbossReservedInternalIsGenericConfigVXView< }; template -inline GenericConfigVXView< +[[nodiscard]] inline GenericConfigVXView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5415,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>( @@ -5424,7 +5400,7 @@ MakeConfigVXView( T *emboss_reserved_local_data, } template -inline GenericConfigVXView< +[[nodiscard]] inline GenericConfigVXView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedConfigVXView( T *emboss_reserved_local_data, @@ -5490,45 +5466,40 @@ class GenericStructWithUnusedParameterView final { - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -5566,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) && @@ -5613,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(), @@ -5708,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 { @@ -5744,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 @@ -5755,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); } @@ -5779,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 @@ -5790,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); } @@ -5814,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 @@ -5825,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); } @@ -5862,7 +5833,7 @@ struct EmbossReservedInternalIsGenericStructWithUnusedParameterView< }; template -inline GenericStructWithUnusedParameterView< +[[nodiscard]] inline GenericStructWithUnusedParameterView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5877,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>( @@ -5886,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, @@ -5952,49 +5923,41 @@ class GenericStructContainingStructWithUnusedParameterView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_swup().Known()) return false; - if (has_swup().ValueOrDefault() && !swup().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -6032,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) && @@ -6079,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(), @@ -6212,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 { @@ -6242,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 @@ -6253,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); } @@ -6277,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 @@ -6288,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); } @@ -6312,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 @@ -6323,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); } @@ -6360,7 +6323,7 @@ struct EmbossReservedInternalIsGenericStructContainingStructWithUnusedParameterV }; template -inline GenericStructContainingStructWithUnusedParameterView< +[[nodiscard]] inline GenericStructContainingStructWithUnusedParameterView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -6375,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>( @@ -6384,7 +6347,7 @@ MakeStructContainingStructWithUnusedParameterView( T *emboss_reserved_local_data } template -inline GenericStructContainingStructWithUnusedParameterView< +[[nodiscard]] inline GenericStructContainingStructWithUnusedParameterView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructContainingStructWithUnusedParameterView( T *emboss_reserved_local_data, @@ -6451,49 +6414,41 @@ class GenericBiasedValueView final { - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_value().Known()) return false; - if (has_value().ValueOrDefault() && !value().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -6531,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) && @@ -6578,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(), @@ -6692,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 { @@ -6731,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()); @@ -6754,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(); @@ -6769,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); @@ -6777,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 { @@ -6794,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 @@ -6805,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); } @@ -6829,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 @@ -6840,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); } @@ -6864,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 @@ -6875,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); } @@ -6912,7 +6867,7 @@ struct EmbossReservedInternalIsGenericBiasedValueView< }; template -inline GenericBiasedValueView< +[[nodiscard]] inline GenericBiasedValueView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -6927,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>( @@ -6936,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, @@ -7003,49 +6958,41 @@ class GenericVirtualFirstFieldWithParamView final { - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_value().Known()) return false; - if (has_value().ValueOrDefault() && !value().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -7083,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) && @@ -7130,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(), @@ -7263,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 { @@ -7306,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 @@ -7317,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); } @@ -7341,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 @@ -7352,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); } @@ -7376,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 @@ -7387,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); } @@ -7424,7 +7371,7 @@ struct EmbossReservedInternalIsGenericVirtualFirstFieldWithParamView< }; template -inline GenericVirtualFirstFieldWithParamView< +[[nodiscard]] inline GenericVirtualFirstFieldWithParamView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -7439,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>( @@ -7448,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, @@ -7515,49 +7462,41 @@ class GenericConstVirtualFirstFieldWithParamView final { - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -7595,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) && @@ -7642,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(), @@ -7756,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_); } @@ -7784,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 @@ -7795,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 { @@ -7827,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 @@ -7838,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); } @@ -7862,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 @@ -7873,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); } @@ -7897,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 @@ -7908,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); } @@ -7945,7 +7884,7 @@ struct EmbossReservedInternalIsGenericConstVirtualFirstFieldWithParamView< }; template -inline GenericConstVirtualFirstFieldWithParamView< +[[nodiscard]] inline GenericConstVirtualFirstFieldWithParamView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -7960,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>( @@ -7969,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, @@ -8036,52 +7975,41 @@ class GenericSizedArrayOfBiasedValuesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_element_count().Known()) return false; - if (has_element_count().ValueOrDefault() && !element_count().Ok()) return false; - - - if (!has_bias().Known()) return false; - if (has_bias().ValueOrDefault() && !bias().Ok()) return false; - - - if (!has_values().Known()) return false; - if (has_values().ValueOrDefault() && !values().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -8136,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) && @@ -8197,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(), @@ -8368,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 { @@ -8413,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()); @@ -8436,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); @@ -8451,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); @@ -8459,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 { @@ -8476,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 @@ -8487,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); } @@ -8511,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 @@ -8522,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); } @@ -8559,7 +8487,7 @@ struct EmbossReservedInternalIsGenericSizedArrayOfBiasedValuesView< }; template -inline GenericSizedArrayOfBiasedValuesView< +[[nodiscard]] inline GenericSizedArrayOfBiasedValuesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -8574,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>( @@ -8583,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 500813b..82e7515 100644 --- a/testdata/golden_cpp/requires.emb.h +++ b/testdata/golden_cpp/requires.emb.h @@ -189,66 +189,46 @@ class GenericRequiresIntegersView final { - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_ten_through_twenty().Known()) return false; - if (has_ten_through_twenty().ValueOrDefault() && !ten_through_twenty().Ok()) return false; - - - if (!has_disjoint().Known()) return false; - if (has_disjoint().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; - - - 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; - - - 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; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -303,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) && @@ -364,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(), @@ -630,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 { @@ -673,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()); @@ -696,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(); @@ -711,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); @@ -719,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 { @@ -739,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()); @@ -762,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( @@ -778,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; @@ -794,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); @@ -809,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 { @@ -829,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()); @@ -852,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( @@ -868,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; @@ -884,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))); @@ -892,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); @@ -900,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 { @@ -917,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 @@ -928,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); } @@ -952,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 @@ -963,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); } @@ -987,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 @@ -998,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); } @@ -1035,7 +1015,7 @@ struct EmbossReservedInternalIsGenericRequiresIntegersView< }; template -inline GenericRequiresIntegersView< +[[nodiscard]] inline GenericRequiresIntegersView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1050,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>( @@ -1059,7 +1039,7 @@ MakeRequiresIntegersView( T *emboss_reserved_local_data, } template -inline GenericRequiresIntegersView< +[[nodiscard]] inline GenericRequiresIntegersView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedRequiresIntegersView( T *emboss_reserved_local_data, @@ -1163,57 +1143,43 @@ class GenericEmbossReservedAnonymousField2View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; - - - if (!has_b().Known()) return false; - if (has_b().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; - - - if (!has_must_be_false().Known()) return false; - if (has_must_be_false().ValueOrDefault() && !must_be_false().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -1285,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) && @@ -1360,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(), @@ -1569,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 { @@ -1617,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 @@ -1628,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); } @@ -1652,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 @@ -1663,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); } @@ -1687,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 @@ -1698,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); } @@ -1735,7 +1701,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField2View< }; template -inline GenericEmbossReservedAnonymousField2View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField2View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1750,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>( @@ -1759,7 +1725,7 @@ MakeEmbossReservedAnonymousField2View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField2View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField2View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField2View( T *emboss_reserved_local_data, @@ -1820,70 +1786,54 @@ class GenericRequiresBoolsView final { - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; - - - if (!has_b().Known()) return false; - if (has_b().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; - - - if (!has_must_be_false().Known()) return false; - if (has_must_be_false().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; - - - 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; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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; @@ -1904,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) && @@ -1937,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(), @@ -2203,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 { @@ -2256,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()); @@ -2279,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)); @@ -2292,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); @@ -2300,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 { @@ -2320,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()); @@ -2343,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( @@ -2359,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; @@ -2375,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); @@ -2390,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 { @@ -2407,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 @@ -2418,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); } @@ -2442,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 @@ -2453,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); } @@ -2477,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 @@ -2488,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); } @@ -2525,7 +2475,7 @@ struct EmbossReservedInternalIsGenericRequiresBoolsView< }; template -inline GenericRequiresBoolsView< +[[nodiscard]] inline GenericRequiresBoolsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2540,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>( @@ -2549,7 +2499,7 @@ MakeRequiresBoolsView( T *emboss_reserved_local_data, } template -inline GenericRequiresBoolsView< +[[nodiscard]] inline GenericRequiresBoolsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedRequiresBoolsView( T *emboss_reserved_local_data, @@ -2738,62 +2688,45 @@ class GenericRequiresEnumsView final { using Enum = ::emboss::test::RequiresEnums::Enum; - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; - - - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; - - - if (!has_c().Known()) return false; - if (has_c().ValueOrDefault() && !c().Ok()) return false; - - - if (!has_filtered_a().Known()) return false; - if (has_filtered_a().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; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -2848,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) && @@ -2909,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(), @@ -3137,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 { @@ -3183,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()); @@ -3206,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))); @@ -3220,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); @@ -3228,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 { @@ -3248,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()); @@ -3271,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( @@ -3287,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; @@ -3303,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); @@ -3318,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 { @@ -3335,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 @@ -3346,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); } @@ -3370,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 @@ -3381,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); } @@ -3405,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 @@ -3416,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); } @@ -3453,7 +3386,7 @@ struct EmbossReservedInternalIsGenericRequiresEnumsView< }; template -inline GenericRequiresEnumsView< +[[nodiscard]] inline GenericRequiresEnumsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3468,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>( @@ -3477,7 +3410,7 @@ MakeRequiresEnumsView( T *emboss_reserved_local_data, } template -inline GenericRequiresEnumsView< +[[nodiscard]] inline GenericRequiresEnumsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedRequiresEnumsView( T *emboss_reserved_local_data, @@ -3566,56 +3499,50 @@ class GenericEmbossReservedAnonymousField1View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; - - - if (!has_b_exists().Known()) return false; - if (has_b_exists().ValueOrDefault() && !b_exists().Ok()) return false; - - - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; - - - if (!has_b_true().Known()) return false; - if (has_b_true().ValueOrDefault() && !b_true().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().ValueOrDefault() && !MinSizeInBits().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_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_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; @@ -3687,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) && @@ -3762,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(), @@ -3971,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 { @@ -4022,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()); @@ -4045,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))); @@ -4059,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); @@ -4067,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 { @@ -4084,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 @@ -4095,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); } @@ -4119,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 @@ -4130,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); } @@ -4167,7 +4094,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField1View< }; template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4182,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>( @@ -4191,7 +4118,7 @@ MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, @@ -4252,62 +4179,68 @@ class GenericRequiresWithOptionalFieldsView final { - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; - - - if (!has_b_exists().Known()) return false; - if (has_b_exists().ValueOrDefault() && !b_exists().Ok()) return false; - - - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; - - - if (!has_b_true().Known()) return false; - if (has_b_true().ValueOrDefault() && !b_true().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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_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_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; @@ -4328,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) && @@ -4361,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(), @@ -4570,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 { @@ -4620,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 @@ -4631,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); } @@ -4655,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 @@ -4666,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); } @@ -4690,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 @@ -4701,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); } @@ -4738,7 +4671,7 @@ struct EmbossReservedInternalIsGenericRequiresWithOptionalFieldsView< }; template -inline GenericRequiresWithOptionalFieldsView< +[[nodiscard]] inline GenericRequiresWithOptionalFieldsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4753,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>( @@ -4762,7 +4695,7 @@ MakeRequiresWithOptionalFieldsView( T *emboss_reserved_local_data, } template -inline GenericRequiresWithOptionalFieldsView< +[[nodiscard]] inline GenericRequiresWithOptionalFieldsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedRequiresWithOptionalFieldsView( T *emboss_reserved_local_data, @@ -4844,45 +4777,40 @@ class GenericElementView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -4903,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) && @@ -4936,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(), @@ -5031,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 { @@ -5055,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 @@ -5066,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); } @@ -5090,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 @@ -5101,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); } @@ -5125,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 @@ -5136,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); } @@ -5173,7 +5101,7 @@ struct EmbossReservedInternalIsGenericElementView< }; template -inline GenericElementView< +[[nodiscard]] inline GenericElementView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5188,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>( @@ -5197,7 +5125,7 @@ MakeElementView( T *emboss_reserved_local_data, } template -inline GenericElementView< +[[nodiscard]] inline GenericElementView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedElementView( T *emboss_reserved_local_data, @@ -5258,45 +5186,40 @@ class GenericRequiresInArrayElementsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_xs().Known()) return false; - if (has_xs().ValueOrDefault() && !xs().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -5317,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) && @@ -5350,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(), @@ -5445,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 { @@ -5471,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 @@ -5482,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); } @@ -5506,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 @@ -5517,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); } @@ -5541,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 @@ -5552,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); } @@ -5589,7 +5512,7 @@ struct EmbossReservedInternalIsGenericRequiresInArrayElementsView< }; template -inline GenericRequiresInArrayElementsView< +[[nodiscard]] inline GenericRequiresInArrayElementsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5604,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>( @@ -5613,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 d9f0166..34a58ab 100644 --- a/testdata/golden_cpp/start_size_range.emb.h +++ b/testdata/golden_cpp/start_size_range.emb.h @@ -90,56 +90,42 @@ class GenericStartSizeView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_size().Known()) return false; - if (has_size().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; - - - if (!has_payload().Known()) return false; - if (has_payload().ValueOrDefault() && !payload().Ok()) return false; - - - if (!has_counter().Known()) return false; - if (has_counter().ValueOrDefault() && !counter().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -211,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) && @@ -286,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(), @@ -495,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>> @@ -523,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 { @@ -550,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()); @@ -573,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); @@ -590,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); @@ -598,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 { @@ -615,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 @@ -626,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); } @@ -650,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 @@ -661,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); } @@ -698,7 +684,7 @@ struct EmbossReservedInternalIsGenericStartSizeView< }; template -inline GenericStartSizeView< +[[nodiscard]] inline GenericStartSizeView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -713,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>( @@ -722,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 860d554..0987f5a 100644 --- a/testdata/golden_cpp/subtypes.emb.h +++ b/testdata/golden_cpp/subtypes.emb.h @@ -223,53 +223,42 @@ class GenericInInView final { using InInIn = ::emboss::test::Out::In::InIn::InInIn; - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_outer_offset().Known()) return false; - if (has_outer_offset().ValueOrDefault() && !outer_offset().Ok()) return false; - - - if (!has_field_enum().Known()) return false; - if (has_field_enum().ValueOrDefault() && !field_enum().Ok()) return false; - - - if (!has_in_2().Known()) return false; - if (has_in_2().ValueOrDefault() && !in_2().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -307,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) && @@ -354,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(), @@ -506,7 +495,7 @@ class GenericInInView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: class EmbossReservedVirtualOuterOffsetView final { @@ -522,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 @@ -533,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 { @@ -572,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 @@ -583,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); } @@ -607,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 @@ -618,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); } @@ -642,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 @@ -653,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); } @@ -690,7 +679,7 @@ struct EmbossReservedInternalIsGenericInInView< }; template -inline GenericInInView< +[[nodiscard]] inline GenericInInView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -705,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>( @@ -714,7 +703,7 @@ MakeInInView( T *emboss_reserved_local_data, } template -inline GenericInInView< +[[nodiscard]] inline GenericInInView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedInInView( T *emboss_reserved_local_data, @@ -775,64 +764,44 @@ class GenericInView final { - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_in_in_2().Known()) return false; - if (has_in_in_2().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; - - - if (!has_in_2().Known()) return false; - if (has_in_2().ValueOrDefault() && !in_2().Ok()) return false; - - - if (!has_name_collision().Known()) return false; - if (has_name_collision().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; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -938,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) && @@ -1041,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(), @@ -1326,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 { @@ -1388,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()); @@ -1411,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))); @@ -1426,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); @@ -1434,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 { @@ -1451,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 @@ -1462,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); } @@ -1486,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 @@ -1497,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); } @@ -1534,7 +1503,7 @@ struct EmbossReservedInternalIsGenericInView< }; template -inline GenericInView< +[[nodiscard]] inline GenericInView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1549,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>( @@ -1558,7 +1527,7 @@ MakeInView( T *emboss_reserved_local_data, } template -inline GenericInView< +[[nodiscard]] inline GenericInView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedInView( T *emboss_reserved_local_data, @@ -1624,45 +1593,40 @@ class GenericIn2View final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_field_byte().Known()) return false; - if (has_field_byte().ValueOrDefault() && !field_byte().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -1683,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) && @@ -1716,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(), @@ -1811,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 { @@ -1835,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 @@ -1846,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); } @@ -1870,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 @@ -1881,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); } @@ -1905,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 @@ -1916,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); } @@ -1953,7 +1917,7 @@ struct EmbossReservedInternalIsGenericIn2View< }; template -inline GenericIn2View< +[[nodiscard]] inline GenericIn2View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1968,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>( @@ -1977,7 +1941,7 @@ MakeIn2View( T *emboss_reserved_local_data, } template -inline GenericIn2View< +[[nodiscard]] inline GenericIn2View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedIn2View( T *emboss_reserved_local_data, @@ -2038,73 +2002,47 @@ class GenericOutView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_in_1().Known()) return false; - if (has_in_1().ValueOrDefault() && !in_1().Ok()) return false; - - - if (!has_in_2().Known()) return false; - if (has_in_2().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; - - - if (!has_in_in_2().Known()) return false; - if (has_in_in_2().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; - - - if (!has_in_in_in_2().Known()) return false; - if (has_in_in_in_2().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; - - - if (!has_nested_constant_check().Known()) return false; - if (has_nested_constant_check().ValueOrDefault() && !nested_constant_check().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -2244,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) && @@ -2375,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(), @@ -2736,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 { @@ -2810,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 @@ -2821,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); } @@ -2845,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 @@ -2856,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); } @@ -2880,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 @@ -2891,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); } @@ -2928,7 +2866,7 @@ struct EmbossReservedInternalIsGenericOutView< }; template -inline GenericOutView< +[[nodiscard]] inline GenericOutView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2943,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>( @@ -2952,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 46f257d..b87a161 100644 --- a/testdata/golden_cpp/text_format.emb.h +++ b/testdata/golden_cpp/text_format.emb.h @@ -104,49 +104,41 @@ class GenericVanillaView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; - - - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -184,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) && @@ -231,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(), @@ -364,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 { @@ -396,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 @@ -407,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); } @@ -431,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 @@ -442,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); } @@ -466,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 @@ -477,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); } @@ -514,7 +506,7 @@ struct EmbossReservedInternalIsGenericVanillaView< }; template -inline GenericVanillaView< +[[nodiscard]] inline GenericVanillaView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -529,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>( @@ -538,7 +530,7 @@ MakeVanillaView( T *emboss_reserved_local_data, } template -inline GenericVanillaView< +[[nodiscard]] inline GenericVanillaView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedVanillaView( T *emboss_reserved_local_data, @@ -605,53 +597,42 @@ class GenericStructWithSkippedFieldsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; - - - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; - - - if (!has_c().Known()) return false; - if (has_c().ValueOrDefault() && !c().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -706,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) && @@ -767,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(), @@ -908,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 { @@ -948,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 @@ -959,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); } @@ -983,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 @@ -994,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); } @@ -1018,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 @@ -1029,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); } @@ -1066,7 +1047,7 @@ struct EmbossReservedInternalIsGenericStructWithSkippedFieldsView< }; template -inline GenericStructWithSkippedFieldsView< +[[nodiscard]] inline GenericStructWithSkippedFieldsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1081,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>( @@ -1090,7 +1071,7 @@ MakeStructWithSkippedFieldsView( T *emboss_reserved_local_data, } template -inline GenericStructWithSkippedFieldsView< +[[nodiscard]] inline GenericStructWithSkippedFieldsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructWithSkippedFieldsView( T *emboss_reserved_local_data, @@ -1157,53 +1138,42 @@ class GenericStructWithSkippedStructureFieldsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; - - - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; - - - if (!has_c().Known()) return false; - if (has_c().ValueOrDefault() && !c().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -1258,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) && @@ -1319,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(), @@ -1460,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 { @@ -1494,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 @@ -1505,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); } @@ -1529,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 @@ -1540,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); } @@ -1564,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 @@ -1575,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); } @@ -1612,7 +1582,7 @@ struct EmbossReservedInternalIsGenericStructWithSkippedStructureFieldsView< }; template -inline GenericStructWithSkippedStructureFieldsView< +[[nodiscard]] inline GenericStructWithSkippedStructureFieldsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1627,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>( @@ -1636,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 df5eb3f..e0c25d0 100644 --- a/testdata/golden_cpp/uint_sizes.emb.h +++ b/testdata/golden_cpp/uint_sizes.emb.h @@ -146,73 +146,47 @@ class GenericSizesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; - - - if (!has_two_byte().Known()) return false; - if (has_two_byte().ValueOrDefault() && !two_byte().Ok()) return false; - - - if (!has_three_byte().Known()) return false; - if (has_three_byte().ValueOrDefault() && !three_byte().Ok()) return false; - - - if (!has_four_byte().Known()) return false; - if (has_four_byte().ValueOrDefault() && !four_byte().Ok()) return false; - - - if (!has_five_byte().Known()) return false; - if (has_five_byte().ValueOrDefault() && !five_byte().Ok()) return false; - - - if (!has_six_byte().Known()) return false; - if (has_six_byte().ValueOrDefault() && !six_byte().Ok()) return false; - - - if (!has_seven_byte().Known()) return false; - if (has_seven_byte().ValueOrDefault() && !seven_byte().Ok()) return false; - - - if (!has_eight_byte().Known()) return false; - if (has_eight_byte().ValueOrDefault() && !eight_byte().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -352,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) && @@ -483,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(), @@ -844,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 { @@ -924,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 @@ -935,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); } @@ -959,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 @@ -970,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); } @@ -994,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 @@ -1005,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); } @@ -1042,7 +1016,7 @@ struct EmbossReservedInternalIsGenericSizesView< }; template -inline GenericSizesView< +[[nodiscard]] inline GenericSizesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1057,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>( @@ -1066,7 +1040,7 @@ MakeSizesView( T *emboss_reserved_local_data, } template -inline GenericSizesView< +[[nodiscard]] inline GenericSizesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedSizesView( T *emboss_reserved_local_data, @@ -1138,73 +1112,47 @@ class GenericBigEndianSizesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; - - - if (!has_two_byte().Known()) return false; - if (has_two_byte().ValueOrDefault() && !two_byte().Ok()) return false; - - - if (!has_three_byte().Known()) return false; - if (has_three_byte().ValueOrDefault() && !three_byte().Ok()) return false; - - - if (!has_four_byte().Known()) return false; - if (has_four_byte().ValueOrDefault() && !four_byte().Ok()) return false; - - - if (!has_five_byte().Known()) return false; - if (has_five_byte().ValueOrDefault() && !five_byte().Ok()) return false; - - - if (!has_six_byte().Known()) return false; - if (has_six_byte().ValueOrDefault() && !six_byte().Ok()) return false; - - - if (!has_seven_byte().Known()) return false; - if (has_seven_byte().ValueOrDefault() && !seven_byte().Ok()) return false; - - - if (!has_eight_byte().Known()) return false; - if (has_eight_byte().ValueOrDefault() && !eight_byte().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -1344,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) && @@ -1475,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(), @@ -1836,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 { @@ -1916,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 @@ -1927,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); } @@ -1951,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 @@ -1962,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); } @@ -1986,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 @@ -1997,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); } @@ -2034,7 +1982,7 @@ struct EmbossReservedInternalIsGenericBigEndianSizesView< }; template -inline GenericBigEndianSizesView< +[[nodiscard]] inline GenericBigEndianSizesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2049,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>( @@ -2058,7 +2006,7 @@ MakeBigEndianSizesView( T *emboss_reserved_local_data, } template -inline GenericBigEndianSizesView< +[[nodiscard]] inline GenericBigEndianSizesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedBigEndianSizesView( T *emboss_reserved_local_data, @@ -2130,73 +2078,47 @@ class GenericAlternatingEndianSizesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; - - - if (!has_two_byte().Known()) return false; - if (has_two_byte().ValueOrDefault() && !two_byte().Ok()) return false; - - - if (!has_three_byte().Known()) return false; - if (has_three_byte().ValueOrDefault() && !three_byte().Ok()) return false; - - - if (!has_four_byte().Known()) return false; - if (has_four_byte().ValueOrDefault() && !four_byte().Ok()) return false; - - - if (!has_five_byte().Known()) return false; - if (has_five_byte().ValueOrDefault() && !five_byte().Ok()) return false; - - - if (!has_six_byte().Known()) return false; - if (has_six_byte().ValueOrDefault() && !six_byte().Ok()) return false; - - - if (!has_seven_byte().Known()) return false; - if (has_seven_byte().ValueOrDefault() && !seven_byte().Ok()) return false; - - - if (!has_eight_byte().Known()) return false; - if (has_eight_byte().ValueOrDefault() && !eight_byte().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -2336,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) && @@ -2467,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(), @@ -2828,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 { @@ -2908,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 @@ -2919,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); } @@ -2943,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 @@ -2954,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); } @@ -2978,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 @@ -2989,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); } @@ -3026,7 +2948,7 @@ struct EmbossReservedInternalIsGenericAlternatingEndianSizesView< }; template -inline GenericAlternatingEndianSizesView< +[[nodiscard]] inline GenericAlternatingEndianSizesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3041,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>( @@ -3050,7 +2972,7 @@ MakeAlternatingEndianSizesView( T *emboss_reserved_local_data, } template -inline GenericAlternatingEndianSizesView< +[[nodiscard]] inline GenericAlternatingEndianSizesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedAlternatingEndianSizesView( T *emboss_reserved_local_data, @@ -3122,73 +3044,47 @@ class GenericEnumSizesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; - - - if (!has_two_byte().Known()) return false; - if (has_two_byte().ValueOrDefault() && !two_byte().Ok()) return false; - - - if (!has_three_byte().Known()) return false; - if (has_three_byte().ValueOrDefault() && !three_byte().Ok()) return false; - - - if (!has_four_byte().Known()) return false; - if (has_four_byte().ValueOrDefault() && !four_byte().Ok()) return false; - - - if (!has_five_byte().Known()) return false; - if (has_five_byte().ValueOrDefault() && !five_byte().Ok()) return false; - - - if (!has_six_byte().Known()) return false; - if (has_six_byte().ValueOrDefault() && !six_byte().Ok()) return false; - - - if (!has_seven_byte().Known()) return false; - if (has_seven_byte().ValueOrDefault() && !seven_byte().Ok()) return false; - - - if (!has_eight_byte().Known()) return false; - if (has_eight_byte().ValueOrDefault() && !eight_byte().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -3328,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) && @@ -3459,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(), @@ -3820,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 { @@ -3908,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 @@ -3919,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); } @@ -3943,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 @@ -3954,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); } @@ -3978,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 @@ -3989,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); } @@ -4026,7 +3922,7 @@ struct EmbossReservedInternalIsGenericEnumSizesView< }; template -inline GenericEnumSizesView< +[[nodiscard]] inline GenericEnumSizesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4041,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>( @@ -4050,7 +3946,7 @@ MakeEnumSizesView( T *emboss_reserved_local_data, } template -inline GenericEnumSizesView< +[[nodiscard]] inline GenericEnumSizesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEnumSizesView( T *emboss_reserved_local_data, @@ -4123,45 +4019,40 @@ class GenericEmbossReservedAnonymousField1View final { - bool Ok() const { + [[nodiscard]] 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; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -4182,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) && @@ -4215,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(), @@ -4310,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 { @@ -4335,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 @@ -4346,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); } @@ -4370,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 @@ -4381,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); } @@ -4405,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 @@ -4416,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); } @@ -4453,7 +4344,7 @@ struct EmbossReservedInternalIsGenericEmbossReservedAnonymousField1View< }; template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4468,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>( @@ -4477,7 +4368,7 @@ MakeEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, } template -inline GenericEmbossReservedAnonymousField1View< +[[nodiscard]] inline GenericEmbossReservedAnonymousField1View< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedEmbossReservedAnonymousField1View( T *emboss_reserved_local_data, @@ -4538,61 +4429,51 @@ class GenericExplicitlySizedEnumSizesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; - - - if (!has_two_byte().Known()) return false; - if (has_two_byte().ValueOrDefault() && !two_byte().Ok()) return false; - - - if (!has_three_byte().Known()) return false; - if (has_three_byte().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; - - - 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; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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; @@ -4664,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) && @@ -4739,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(), @@ -4948,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 { @@ -5004,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 @@ -5015,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); } @@ -5039,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 @@ -5050,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); } @@ -5074,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 @@ -5085,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); } @@ -5122,7 +5003,7 @@ struct EmbossReservedInternalIsGenericExplicitlySizedEnumSizesView< }; template -inline GenericExplicitlySizedEnumSizesView< +[[nodiscard]] inline GenericExplicitlySizedEnumSizesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5137,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>( @@ -5146,7 +5027,7 @@ MakeExplicitlySizedEnumSizesView( T *emboss_reserved_local_data, } template -inline GenericExplicitlySizedEnumSizesView< +[[nodiscard]] inline GenericExplicitlySizedEnumSizesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedExplicitlySizedEnumSizesView( T *emboss_reserved_local_data, @@ -5512,73 +5393,47 @@ class GenericArraySizesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_one_byte().Known()) return false; - if (has_one_byte().ValueOrDefault() && !one_byte().Ok()) return false; - - - if (!has_two_byte().Known()) return false; - if (has_two_byte().ValueOrDefault() && !two_byte().Ok()) return false; - - - if (!has_three_byte().Known()) return false; - if (has_three_byte().ValueOrDefault() && !three_byte().Ok()) return false; - - - if (!has_four_byte().Known()) return false; - if (has_four_byte().ValueOrDefault() && !four_byte().Ok()) return false; - - - if (!has_five_byte().Known()) return false; - if (has_five_byte().ValueOrDefault() && !five_byte().Ok()) return false; - - - if (!has_six_byte().Known()) return false; - if (has_six_byte().ValueOrDefault() && !six_byte().Ok()) return false; - - - if (!has_seven_byte().Known()) return false; - if (has_seven_byte().ValueOrDefault() && !seven_byte().Ok()) return false; - - - if (!has_eight_byte().Known()) return false; - if (has_eight_byte().ValueOrDefault() && !eight_byte().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -5718,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) && @@ -5849,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(), @@ -6210,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>> @@ -6222,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>> @@ -6234,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>> @@ -6246,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>> @@ -6258,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>> @@ -6270,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>> @@ -6282,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>> @@ -6294,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>> @@ -6306,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 { @@ -6322,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 @@ -6333,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); } @@ -6357,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 @@ -6368,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); } @@ -6392,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 @@ -6403,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); } @@ -6440,7 +6295,7 @@ struct EmbossReservedInternalIsGenericArraySizesView< }; template -inline GenericArraySizesView< +[[nodiscard]] inline GenericArraySizesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -6455,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>( @@ -6464,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 140020a..81804fd 100644 --- a/testdata/golden_cpp/virtual_field.emb.h +++ b/testdata/golden_cpp/virtual_field.emb.h @@ -250,81 +250,49 @@ class GenericStructureWithConstantsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_ten().Known()) return false; - if (has_ten().ValueOrDefault() && !ten().Ok()) return false; - - - if (!has_twenty().Known()) return false; - if (has_twenty().ValueOrDefault() && !twenty().Ok()) return false; - - - if (!has_four_billion().Known()) return false; - if (has_four_billion().ValueOrDefault() && !four_billion().Ok()) return false; - - - if (!has_ten_billion().Known()) return false; - if (has_ten_billion().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; - - - if (!has_value().Known()) return false; - if (has_value().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; - - - 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; - - - if (!has_alias_of_ten().Known()) return false; - if (has_alias_of_ten().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; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -345,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) && @@ -378,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(), @@ -682,7 +650,7 @@ class GenericStructureWithConstantsView final { - static constexpr bool IsAggregate() { return true; } + [[nodiscard]] static constexpr bool IsAggregate() { return true; } public: class EmbossReservedVirtualTenView final { @@ -698,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 @@ -709,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); } @@ -733,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 @@ -744,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); } @@ -768,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 @@ -779,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); } @@ -803,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 @@ -814,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); } @@ -838,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 @@ -849,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 { @@ -895,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 @@ -906,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); } @@ -930,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 @@ -941,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); } @@ -965,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 @@ -976,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); } @@ -1000,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 @@ -1011,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); } @@ -1035,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 @@ -1046,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); } @@ -1083,7 +1051,7 @@ struct EmbossReservedInternalIsGenericStructureWithConstantsView< }; template -inline GenericStructureWithConstantsView< +[[nodiscard]] inline GenericStructureWithConstantsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -1098,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>( @@ -1107,7 +1075,7 @@ MakeStructureWithConstantsView( T *emboss_reserved_local_data, } template -inline GenericStructureWithConstantsView< +[[nodiscard]] inline GenericStructureWithConstantsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructureWithConstantsView( T *emboss_reserved_local_data, @@ -1178,69 +1146,46 @@ class GenericStructureWithComputedValuesView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_value().Known()) return false; - if (has_value().ValueOrDefault() && !value().Ok()) return false; - - - if (!has_doubled().Known()) return false; - if (has_doubled().ValueOrDefault() && !doubled().Ok()) return false; - - - if (!has_plus_ten().Known()) return false; - if (has_plus_ten().ValueOrDefault() && !plus_ten().Ok()) return false; - - - if (!has_value2().Known()) return false; - if (has_value2().ValueOrDefault() && !value2().Ok()) return false; - - - if (!has_signed_doubled().Known()) return false; - if (has_signed_doubled().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; - - - if (!has_product().Known()) return false; - if (has_product().ValueOrDefault() && !product().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -1278,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) && @@ -1325,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(), @@ -1591,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 { @@ -1618,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()); @@ -1641,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))); @@ -1654,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); @@ -1662,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 { @@ -1682,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()); @@ -1705,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( @@ -1721,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; @@ -1737,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))); @@ -1745,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); @@ -1753,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 { @@ -1781,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()); @@ -1804,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))); @@ -1817,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); @@ -1825,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 { @@ -1845,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()); @@ -1868,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( @@ -1884,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; @@ -1900,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))); @@ -1908,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); @@ -1916,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 { @@ -1936,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()); @@ -1959,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(); @@ -1974,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); @@ -1982,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 { @@ -1999,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 @@ -2010,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); } @@ -2034,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 @@ -2045,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); } @@ -2069,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 @@ -2080,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); } @@ -2117,7 +2062,7 @@ struct EmbossReservedInternalIsGenericStructureWithComputedValuesView< }; template -inline GenericStructureWithComputedValuesView< +[[nodiscard]] inline GenericStructureWithComputedValuesView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2132,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>( @@ -2141,7 +2086,7 @@ MakeStructureWithComputedValuesView( T *emboss_reserved_local_data, } template -inline GenericStructureWithComputedValuesView< +[[nodiscard]] inline GenericStructureWithComputedValuesView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructureWithComputedValuesView( T *emboss_reserved_local_data, @@ -2208,53 +2153,51 @@ class GenericStructureWithConditionalValueView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_two_x().Known()) return false; - if (has_two_x().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; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_reserved_local_ok_subexpr_2, ::emboss::support::Maybe(static_cast(2147483648ULL))); + + { + 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_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; @@ -2275,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) && @@ -2308,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(), @@ -2460,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 { @@ -2487,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()); @@ -2510,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))); @@ -2523,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); @@ -2531,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 { @@ -2551,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()); @@ -2574,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( @@ -2590,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; @@ -2606,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))); @@ -2614,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); @@ -2622,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 { @@ -2639,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 @@ -2650,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); } @@ -2674,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 @@ -2685,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); } @@ -2709,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 @@ -2720,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); } @@ -2757,7 +2700,7 @@ struct EmbossReservedInternalIsGenericStructureWithConditionalValueView< }; template -inline GenericStructureWithConditionalValueView< +[[nodiscard]] inline GenericStructureWithConditionalValueView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -2772,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>( @@ -2781,7 +2724,7 @@ MakeStructureWithConditionalValueView( T *emboss_reserved_local_data, } template -inline GenericStructureWithConditionalValueView< +[[nodiscard]] inline GenericStructureWithConditionalValueView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructureWithConditionalValueView( T *emboss_reserved_local_data, @@ -2848,52 +2791,50 @@ class GenericStructureWithValueInConditionView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_two_x().Known()) return false; - if (has_two_x().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; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) 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_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_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; @@ -2931,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) && @@ -2978,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(), @@ -3130,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 { @@ -3157,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()); @@ -3180,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))); @@ -3193,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); @@ -3201,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 { @@ -3229,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()); @@ -3252,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))); @@ -3267,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); @@ -3275,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 { @@ -3292,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 @@ -3303,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); } @@ -3327,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 @@ -3338,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); } @@ -3375,7 +3316,7 @@ struct EmbossReservedInternalIsGenericStructureWithValueInConditionView< }; template -inline GenericStructureWithValueInConditionView< +[[nodiscard]] inline GenericStructureWithValueInConditionView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -3390,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>( @@ -3399,7 +3340,7 @@ MakeStructureWithValueInConditionView( T *emboss_reserved_local_data, } template -inline GenericStructureWithValueInConditionView< +[[nodiscard]] inline GenericStructureWithValueInConditionView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructureWithValueInConditionView( T *emboss_reserved_local_data, @@ -3467,56 +3408,42 @@ class GenericStructureWithValuesInLocationView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_two_x().Known()) return false; - if (has_two_x().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; - - - if (!has_size_two_x().Known()) return false; - if (has_size_two_x().ValueOrDefault() && !size_two_x().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -3571,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) && @@ -3632,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(), @@ -3822,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 { @@ -3849,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()); @@ -3872,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))); @@ -3885,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); @@ -3893,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 { @@ -3929,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()); @@ -3952,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))); @@ -3969,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); @@ -3977,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 { @@ -3994,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 @@ -4005,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); } @@ -4029,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 @@ -4040,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); } @@ -4077,7 +4004,7 @@ struct EmbossReservedInternalIsGenericStructureWithValuesInLocationView< }; template -inline GenericStructureWithValuesInLocationView< +[[nodiscard]] inline GenericStructureWithValuesInLocationView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4092,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>( @@ -4101,7 +4028,7 @@ MakeStructureWithValuesInLocationView( T *emboss_reserved_local_data, } template -inline GenericStructureWithValuesInLocationView< +[[nodiscard]] inline GenericStructureWithValuesInLocationView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructureWithValuesInLocationView( T *emboss_reserved_local_data, @@ -4167,49 +4094,41 @@ class GenericStructureWithBoolValueView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().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; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -4230,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) && @@ -4263,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(), @@ -4377,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 { @@ -4404,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()); @@ -4427,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))); @@ -4440,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); @@ -4448,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 { @@ -4465,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 @@ -4476,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); } @@ -4500,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 @@ -4511,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); } @@ -4535,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 @@ -4546,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); } @@ -4583,7 +4502,7 @@ struct EmbossReservedInternalIsGenericStructureWithBoolValueView< }; template -inline GenericStructureWithBoolValueView< +[[nodiscard]] inline GenericStructureWithBoolValueView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -4598,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>( @@ -4607,7 +4526,7 @@ MakeStructureWithBoolValueView( T *emboss_reserved_local_data, } template -inline GenericStructureWithBoolValueView< +[[nodiscard]] inline GenericStructureWithBoolValueView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructureWithBoolValueView( T *emboss_reserved_local_data, @@ -4760,49 +4679,41 @@ class GenericStructureWithEnumValueView final { using Category = ::emboss::test::StructureWithEnumValue::Category; - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_x_size().Known()) return false; - if (has_x_size().ValueOrDefault() && !x_size().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -4823,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) && @@ -4856,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(), @@ -4970,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 { @@ -4997,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()); @@ -5020,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))); @@ -5034,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); @@ -5042,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 { @@ -5059,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 @@ -5070,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); } @@ -5094,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 @@ -5105,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); } @@ -5129,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 @@ -5140,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); } @@ -5177,7 +5088,7 @@ struct EmbossReservedInternalIsGenericStructureWithEnumValueView< }; template -inline GenericStructureWithEnumValueView< +[[nodiscard]] inline GenericStructureWithEnumValueView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5192,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>( @@ -5201,7 +5112,7 @@ MakeStructureWithEnumValueView( T *emboss_reserved_local_data, } template -inline GenericStructureWithEnumValueView< +[[nodiscard]] inline GenericStructureWithEnumValueView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructureWithEnumValueView( T *emboss_reserved_local_data, @@ -5268,53 +5179,42 @@ class GenericStructureWithBitsWithValueView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_b().Known()) return false; - if (has_b().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; - - - if (!has_alias_of_b_a().Known()) return false; - if (has_alias_of_b_a().ValueOrDefault() && !alias_of_b_a().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -5335,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) && @@ -5368,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(), @@ -5520,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 { @@ -5545,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()); @@ -5568,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); @@ -5588,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 { @@ -5612,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 @@ -5623,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); } @@ -5647,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 @@ -5658,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); } @@ -5682,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 @@ -5693,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); } @@ -5730,7 +5630,7 @@ struct EmbossReservedInternalIsGenericStructureWithBitsWithValueView< }; template -inline GenericStructureWithBitsWithValueView< +[[nodiscard]] inline GenericStructureWithBitsWithValueView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -5745,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>( @@ -5754,7 +5654,7 @@ MakeStructureWithBitsWithValueView( T *emboss_reserved_local_data, } template -inline GenericStructureWithBitsWithValueView< +[[nodiscard]] inline GenericStructureWithBitsWithValueView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructureWithBitsWithValueView( T *emboss_reserved_local_data, @@ -5821,53 +5721,42 @@ class GenericBitsWithValueView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_a().Known()) return false; - if (has_a().ValueOrDefault() && !a().Ok()) return false; - - - if (!has_b().Known()) return false; - if (has_b().ValueOrDefault() && !b().Ok()) return false; - - - if (!has_sum().Known()) return false; - if (has_sum().ValueOrDefault() && !sum().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().ValueOrDefault() && !IntrinsicSizeInBits().Ok()) return false; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -5905,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) && @@ -5952,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(), @@ -6104,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 { @@ -6139,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()); @@ -6162,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(); @@ -6177,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); @@ -6185,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 { @@ -6202,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 @@ -6213,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); } @@ -6237,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 @@ -6248,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); } @@ -6272,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 @@ -6283,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); } @@ -6320,7 +6209,7 @@ struct EmbossReservedInternalIsGenericBitsWithValueView< }; template -inline GenericBitsWithValueView< +[[nodiscard]] inline GenericBitsWithValueView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -6335,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>( @@ -6344,7 +6233,7 @@ MakeBitsWithValueView( T *emboss_reserved_local_data, } template -inline GenericBitsWithValueView< +[[nodiscard]] inline GenericBitsWithValueView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedBitsWithValueView( T *emboss_reserved_local_data, @@ -6410,49 +6299,41 @@ class GenericStructureUsingForeignConstantsView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_one_hundred().Known()) return false; - if (has_one_hundred().ValueOrDefault() && !one_hundred().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -6473,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) && @@ -6506,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(), @@ -6620,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 { @@ -6644,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 @@ -6655,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); } @@ -6679,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 @@ -6690,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); } @@ -6714,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 @@ -6725,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); } @@ -6749,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 @@ -6760,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); } @@ -6797,7 +6678,7 @@ struct EmbossReservedInternalIsGenericStructureUsingForeignConstantsView< }; template -inline GenericStructureUsingForeignConstantsView< +[[nodiscard]] inline GenericStructureUsingForeignConstantsView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -6812,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>( @@ -6821,7 +6702,7 @@ MakeStructureUsingForeignConstantsView( T *emboss_reserved_local_data, } template -inline GenericStructureUsingForeignConstantsView< +[[nodiscard]] inline GenericStructureUsingForeignConstantsView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedStructureUsingForeignConstantsView( T *emboss_reserved_local_data, @@ -6893,49 +6774,41 @@ class GenericHeaderView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_size().Known()) return false; - if (has_size().ValueOrDefault() && !size().Ok()) return false; - - - if (!has_message_id().Known()) return false; - if (has_message_id().ValueOrDefault() && !message_id().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -6973,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) && @@ -7020,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(), @@ -7153,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 { @@ -7185,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 @@ -7196,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); } @@ -7220,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 @@ -7231,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); } @@ -7255,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 @@ -7266,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); } @@ -7303,7 +7176,7 @@ struct EmbossReservedInternalIsGenericHeaderView< }; template -inline GenericHeaderView< +[[nodiscard]] inline GenericHeaderView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -7318,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>( @@ -7327,7 +7200,7 @@ MakeHeaderView( T *emboss_reserved_local_data, } template -inline GenericHeaderView< +[[nodiscard]] inline GenericHeaderView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedHeaderView( T *emboss_reserved_local_data, @@ -7388,53 +7261,42 @@ class GenericSubfieldOfAliasView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_header().Known()) return false; - if (has_header().ValueOrDefault() && !header().Ok()) return false; - - - if (!has_h().Known()) return false; - if (has_h().ValueOrDefault() && !h().Ok()) return false; - - - if (!has_size().Known()) return false; - if (has_size().ValueOrDefault() && !size().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -7455,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) && @@ -7488,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(), @@ -7659,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 { @@ -7695,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 @@ -7706,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); } @@ -7730,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 @@ -7741,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); } @@ -7765,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 @@ -7776,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); } @@ -7813,7 +7675,7 @@ struct EmbossReservedInternalIsGenericSubfieldOfAliasView< }; template -inline GenericSubfieldOfAliasView< +[[nodiscard]] inline GenericSubfieldOfAliasView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -7828,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>( @@ -7837,7 +7699,7 @@ MakeSubfieldOfAliasView( T *emboss_reserved_local_data, } template -inline GenericSubfieldOfAliasView< +[[nodiscard]] inline GenericSubfieldOfAliasView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedSubfieldOfAliasView( T *emboss_reserved_local_data, @@ -7904,53 +7766,51 @@ class GenericRestrictedAliasView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_a_b().Known()) return false; - if (has_a_b().ValueOrDefault() && !a_b().Ok()) return false; - - - if (!has_alias_switch().Known()) return false; - if (has_alias_switch().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; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) 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_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_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; @@ -7988,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) && @@ -8035,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(), @@ -8206,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 { @@ -8243,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 @@ -8254,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); } @@ -8278,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 @@ -8289,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); } @@ -8313,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 @@ -8324,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); } @@ -8361,7 +8221,7 @@ struct EmbossReservedInternalIsGenericRestrictedAliasView< }; template -inline GenericRestrictedAliasView< +[[nodiscard]] inline GenericRestrictedAliasView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -8376,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>( @@ -8385,7 +8245,7 @@ MakeRestrictedAliasView( T *emboss_reserved_local_data, } template -inline GenericRestrictedAliasView< +[[nodiscard]] inline GenericRestrictedAliasView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedRestrictedAliasView( T *emboss_reserved_local_data, @@ -8458,48 +8318,49 @@ class GenericXView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_v().Known()) return false; - if (has_v().ValueOrDefault() && !v().Ok()) return false; - - - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) 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_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_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; @@ -8537,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) && @@ -8584,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(), @@ -8717,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 { @@ -8752,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()); @@ -8775,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))); @@ -8790,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); @@ -8798,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 { @@ -8815,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 @@ -8826,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); } @@ -8850,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 @@ -8861,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); } @@ -8898,7 +8759,7 @@ struct EmbossReservedInternalIsGenericXView< }; template -inline GenericXView< +[[nodiscard]] inline GenericXView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -8913,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>( @@ -8922,7 +8783,7 @@ MakeXView( T *emboss_reserved_local_data, } template -inline GenericXView< +[[nodiscard]] inline GenericXView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedXView( T *emboss_reserved_local_data, @@ -8983,56 +8844,65 @@ class GenericHasFieldView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_z().Known()) return false; - if (has_z().ValueOrDefault() && !z().Ok()) return false; - - - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_y().Known()) return false; - if (has_y().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; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) 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_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_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_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_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; @@ -9070,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) && @@ -9117,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(), @@ -9307,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 { @@ -9347,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()); @@ -9370,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); @@ -9389,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 { @@ -9409,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()); @@ -9432,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))); @@ -9447,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); @@ -9455,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 { @@ -9472,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 @@ -9483,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); } @@ -9507,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 @@ -9518,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); } @@ -9555,7 +9425,7 @@ struct EmbossReservedInternalIsGenericHasFieldView< }; template -inline GenericHasFieldView< +[[nodiscard]] inline GenericHasFieldView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -9570,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>( @@ -9579,7 +9449,7 @@ MakeHasFieldView( T *emboss_reserved_local_data, } template -inline GenericHasFieldView< +[[nodiscard]] inline GenericHasFieldView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedHasFieldView( T *emboss_reserved_local_data, @@ -9646,52 +9516,51 @@ class GenericVirtualUnconditionallyUsesConditionalView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_xc().Known()) return false; - if (has_xc().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; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().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_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_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; @@ -9729,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) && @@ -9776,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(), @@ -9928,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 { @@ -9963,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()); @@ -9986,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))); @@ -10003,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); @@ -10011,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 { @@ -10031,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()); @@ -10054,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))); @@ -10069,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); @@ -10077,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 { @@ -10094,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 @@ -10105,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); } @@ -10129,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 @@ -10140,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); } @@ -10177,7 +10046,7 @@ struct EmbossReservedInternalIsGenericVirtualUnconditionallyUsesConditionalView< }; template -inline GenericVirtualUnconditionallyUsesConditionalView< +[[nodiscard]] inline GenericVirtualUnconditionallyUsesConditionalView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -10192,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>( @@ -10201,7 +10070,7 @@ MakeVirtualUnconditionallyUsesConditionalView( T *emboss_reserved_local_data, } template -inline GenericVirtualUnconditionallyUsesConditionalView< +[[nodiscard]] inline GenericVirtualUnconditionallyUsesConditionalView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedVirtualUnconditionallyUsesConditionalView( T *emboss_reserved_local_data, @@ -10272,49 +10141,41 @@ class GenericRView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_q().Known()) return false; - if (has_q().ValueOrDefault() && !q().Ok()) return false; - - - if (!has_IntrinsicSizeInBits().Known()) return false; - if (has_IntrinsicSizeInBits().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; - - - if (!has_MaxSizeInBits().Known()) return false; - if (has_MaxSizeInBits().ValueOrDefault() && !MaxSizeInBits().Ok()) return false; - - - if (!has_MinSizeInBits().Known()) return false; - if (has_MinSizeInBits().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; @@ -10335,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) && @@ -10368,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(), @@ -10482,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 { @@ -10506,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 @@ -10517,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); } @@ -10544,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()); @@ -10567,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))); @@ -10580,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); @@ -10588,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 { @@ -10605,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 @@ -10616,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); } @@ -10640,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 @@ -10651,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); } @@ -10688,7 +10549,7 @@ struct EmbossReservedInternalIsGenericRView< }; template -inline GenericRView< +[[nodiscard]] inline GenericRView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -10703,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>( @@ -10712,7 +10573,7 @@ MakeRView( T *emboss_reserved_local_data, } template -inline GenericRView< +[[nodiscard]] inline GenericRView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedRView( T *emboss_reserved_local_data, @@ -10773,49 +10634,41 @@ class GenericUsesSizeView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_r().Known()) return false; - if (has_r().ValueOrDefault() && !r().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().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; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -10836,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) && @@ -10869,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(), @@ -10983,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 { @@ -11005,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 @@ -11016,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); } @@ -11043,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()); @@ -11066,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))); @@ -11079,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); @@ -11087,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 { @@ -11104,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 @@ -11115,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); } @@ -11139,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 @@ -11150,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); } @@ -11187,7 +11040,7 @@ struct EmbossReservedInternalIsGenericUsesSizeView< }; template -inline GenericUsesSizeView< +[[nodiscard]] inline GenericUsesSizeView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -11202,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>( @@ -11211,7 +11064,7 @@ MakeUsesSizeView( T *emboss_reserved_local_data, } template -inline GenericUsesSizeView< +[[nodiscard]] inline GenericUsesSizeView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedUsesSizeView( T *emboss_reserved_local_data, @@ -11277,49 +11130,41 @@ class GenericUsesExternalSizeView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().ValueOrDefault() && !x().Ok()) return false; - - - if (!has_y().Known()) return false; - if (has_y().ValueOrDefault() && !y().Ok()) return false; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -11357,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) && @@ -11404,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(), @@ -11537,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 { @@ -11565,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 @@ -11576,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); } @@ -11600,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 @@ -11611,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); } @@ -11635,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 @@ -11646,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); } @@ -11683,7 +11528,7 @@ struct EmbossReservedInternalIsGenericUsesExternalSizeView< }; template -inline GenericUsesExternalSizeView< +[[nodiscard]] inline GenericUsesExternalSizeView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -11698,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>( @@ -11707,7 +11552,7 @@ MakeUsesExternalSizeView( T *emboss_reserved_local_data, } template -inline GenericUsesExternalSizeView< +[[nodiscard]] inline GenericUsesExternalSizeView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedUsesExternalSizeView( T *emboss_reserved_local_data, @@ -11777,65 +11622,45 @@ class GenericImplicitWriteBackView final { - bool Ok() const { + [[nodiscard]] bool Ok() const { if (!IsComplete()) return false; - if (!has_x().Known()) return false; - if (has_x().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; - - - if (!has_ten_plus_x().Known()) return false; - if (has_ten_plus_x().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; - - - if (!has_ten_minus_x().Known()) return false; - if (has_ten_minus_x().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; - - - if (!has_IntrinsicSizeInBytes().Known()) return false; - if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; - - - if (!has_MaxSizeInBytes().Known()) return false; - if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; - - - if (!has_MinSizeInBytes().Known()) return false; - if (has_MinSizeInBytes().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; @@ -11856,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) && @@ -11889,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(), @@ -12174,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 { @@ -12201,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()); @@ -12224,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( @@ -12240,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; @@ -12256,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))); @@ -12264,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); @@ -12272,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 { @@ -12292,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()); @@ -12315,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( @@ -12331,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; @@ -12347,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); @@ -12355,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); @@ -12363,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 { @@ -12383,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()); @@ -12406,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( @@ -12422,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; @@ -12438,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))); @@ -12446,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); @@ -12454,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 { @@ -12474,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()); @@ -12497,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( @@ -12513,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; @@ -12529,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); @@ -12537,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); @@ -12545,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 { @@ -12565,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()); @@ -12588,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( @@ -12604,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; @@ -12620,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); @@ -12629,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); @@ -12637,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 { @@ -12654,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 @@ -12665,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); } @@ -12689,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 @@ -12700,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); } @@ -12724,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 @@ -12735,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); } @@ -12772,7 +12597,7 @@ struct EmbossReservedInternalIsGenericImplicitWriteBackView< }; template -inline GenericImplicitWriteBackView< +[[nodiscard]] inline GenericImplicitWriteBackView< /**/ ::emboss::support::ContiguousBuffer< typename ::std::remove_reference< decltype(*::std::declval()->data())>::type, @@ -12787,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>( @@ -12796,7 +12621,7 @@ MakeImplicitWriteBackView( T *emboss_reserved_local_data, } template -inline GenericImplicitWriteBackView< +[[nodiscard]] inline GenericImplicitWriteBackView< /**/ ::emboss::support::ContiguousBuffer> MakeAlignedImplicitWriteBackView( T *emboss_reserved_local_data, 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