service/service: Make FunctionInfo's constructor constexpr
Allows our service function arrays to be constexpr.
This commit is contained in:
@@ -122,9 +122,6 @@ class ServiceFramework : public ServiceFrameworkBase {
|
|||||||
protected:
|
protected:
|
||||||
/// Contains information about a request type which is handled by the service.
|
/// Contains information about a request type which is handled by the service.
|
||||||
struct FunctionInfo : FunctionInfoBase {
|
struct FunctionInfo : FunctionInfoBase {
|
||||||
// TODO(yuriks): This function could be constexpr, but clang is the only compiler that
|
|
||||||
// doesn't emit an ICE or a wrong diagnostic because of the static_cast.
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a FunctionInfo for a function.
|
* Constructs a FunctionInfo for a function.
|
||||||
*
|
*
|
||||||
@@ -134,7 +131,8 @@ protected:
|
|||||||
* the request
|
* the request
|
||||||
* @param name human-friendly name for the request. Used mostly for logging purposes.
|
* @param name human-friendly name for the request. Used mostly for logging purposes.
|
||||||
*/
|
*/
|
||||||
FunctionInfo(u32 expected_header, HandlerFnP<Self> handler_callback, const char* name)
|
constexpr FunctionInfo(u32 expected_header, HandlerFnP<Self> handler_callback,
|
||||||
|
const char* name)
|
||||||
: FunctionInfoBase{
|
: FunctionInfoBase{
|
||||||
expected_header,
|
expected_header,
|
||||||
// Type-erase member function pointer by casting it down to the base class.
|
// Type-erase member function pointer by casting it down to the base class.
|
||||||
|
|||||||
Reference in New Issue
Block a user