WPILibC++ 2024.1.1-beta-4
wpi::HasNestedStruct Concept Reference

Specifies that a struct type has nested struct declarations. More...

#include <wpi/struct/Struct.h>

Concept definition

template<typename T>
requires(function_ref<void(std::string_view, std::string_view)> fn) {
Struct<typename std::remove_cvref_t<T>>::ForEachNested(fn);
}
Specifies that a struct type has nested struct declarations.
Definition: Struct.h:108
Specifies that a type is capable of raw struct serialization and deserialization.
Definition: Struct.h:67
basic_string_view< char > string_view
Definition: core.h:501
static void ForEachNested(std::invocable< std::string_view, std::string_view > auto fn)
Definition: MecanumDriveKinematicsStruct.h:28

Detailed Description

Specifies that a struct type has nested struct declarations.

In addition to meeting StructSerializable, implementations must define a wpi::Struct<T> static member void ForEachNested(std::invocable<std::string_view, std::string_view) auto fn) (or equivalent) and call ForEachNestedStruct<Type> on each nested struct type.