Copyright 2023 Travis J. West, https://traviswest.ca, Input Devices and Music Interaction Laboratory (IDMIL), Centre for Interdisciplinary Research in Music Media and Technology (CIRMMT), McGill University, Montréal, Canada, and Univ. Lille, Inria, CNRS, Centrale Lille, UMR 9189 CRIStAL, F-59000 Lille, France
SPDX-License-Identifier: MIT
An entity is considered to have a name if its type has a static method name() that returns something that is convertible to some string representation. The use of std::decay removes cv-ref qualifications on the type and seems to be necessary so that its name can be accessed and recognized when the type is a reference, although I'm not entirely sure why.
_consteval auto name_of() { return std::decay_t<T>::name(); }
In the same way that all textual metadata can be defined using the same pattern, so too can it be detected and accessed. So just as we use a macro in sygah-metadata: Metadata Helpers to generate metadata helpers, here we use one to generate their generic accessors.
// @#'sygac-metadata.hpp'
#pragma once
/*
Copyright 2023 Travis J. West, https://traviswest.ca, Input Devices and Music
Interaction Laboratory (IDMIL), Centre for Interdisciplinary Research in Music
Media and Technology (CIRMMT), McGill University, Montréal, Canada, and Univ.
Lille, Inria, CNRS, Centrale Lille, UMR 9189 CRIStAL, F-59000 Lille, France