WPILibC++ 2024.3.2
wpi::HasNestedStruct Concept Reference

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

#include <wpi/struct/Struct.h>

Concept definition

template<typename T, typename... I>
StructSerializable<T, I...> &&
requires(function_ref<void(std::string_view, std::string_view)> fn,
const I&... info) {
Struct<typename std::remove_cvref_t<T>,
typename std::remove_cvref_t<I>...>::ForEachNested(fn, info...);
}
Specifies that a struct type has nested struct declarations.
Definition: Struct.h:119
Specifies that a type is capable of raw struct serialization and deserialization.
Definition: Struct.h:68
basic_string_view< char > string_view
Definition: core.h:501
static void ForEachNested(std::invocable< std::string_view, std::string_view > auto fn)
Definition: Transform3dStruct.h:27

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.