P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::BMV2::Helpers::CounterlikeTraits< Standard::CounterExtern< Standard::Arch::V1MODEL > > Struct Reference

CounterlikeTraits<> specialization for CounterExtern for v1model More...

#include <helpers.h>

Static Public Member Functions

static const cstring directPropertyName ()
 
static const cstring directTypeName ()
 
static std::optional< size_t > indexTypeParamIdx ()
 
static const cstring name ()
 
static const cstring sizeParamName ()
 
static const cstring typeName ()
 

Detailed Description

CounterlikeTraits<> specialization for CounterExtern for v1model

According to the C++11 standard: An explicit specialization shall be declared in a namespace enclosing the specialized template. An explicit specialization whose declarator-id is not qualified shall be declared in the nearest enclosing namespace of the template, or, if the namespace is inline (7.3.1), any namespace from its enclosing namespace set. Such a declaration may also be a definition. If the declaration is not a definition, the specialization may be defined later (7.3.1.2).

GCC reports an error when trying so specialize CounterlikeTraits<> for Standard::CounterExtern & Standard::MeterExtern outside of the Helpers namespace, even when qualifying CounterlikeTraits<> with Helpers::. It seems to be related to this bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480.