STD :: Conditional_t ​​Bewerten Sie den falschen Ergebnistyp, wenn die Bedingung wahr istC++

Programme in C++. Entwicklerforum
Anonymous
 STD :: Conditional_t ​​Bewerten Sie den falschen Ergebnistyp, wenn die Bedingung wahr ist

Post by Anonymous »

Ich habe derzeit Folgendes: < /p>

Code: Select all

template
struct RequiredTagList
{
static constexpr const TagType index = TTag;
};

// ---------------------------------------------------------------

using fix::TagType = uint16_t;

template
struct Select_Tag_List;

template
struct Select_Tag_List
{
static constexpr const fix::TagType tag_index = TagList::index;

using type = std::conditional_t;
};

template
struct Select_Tag_List
{
static_assert(std::same_as, "Tag not found, see template build stack");
};

template
using select_tag_list = Select_Tag_List;

template
using select_tag_list_t = typename Select_Tag_List::type;
Das Konzept iSTAGLIST Überprüfen Sie, ob t ein erforderlich ist und haben die statische Eigenschaft t :: index (Mitglied der statischen Eigenschaft.

Code: Select all

fix::TagType< /code>)
Aber wenn ich es mit diesem Vorlagenparameter aufrufe: < /p>
Select_Tag_List
Die Liste der Vorlagenargument Fix :: Erforderlich , Fix :: Erforderlich , Fix :: Optional Validieren Sie das ISTAG -Konzept, sind jedoch nicht relevant für das Problem (es könnte jeder Typ sein)
Ich hätte nicht bewertet. Select_tag_list , aber der static_assert wird immer noch ausgelöst. Falsch Wert Wenn das Ergebnis true :
ist

Code: Select all

template 
struct Lazy_Conditional;

template 
struct Lazy_Conditional
{
using type = Then;
};

template 
struct Lazy_Conditional
{
using type = Else;
};

template 
using lazy_conditional = Lazy_Conditional;

template 
using lazy_conditional_t = typename lazy_conditional::type;
, aber ohne Erfolg und immer noch Ende des Updates mit Fehler C2039: 'Typ': Ist kein Mitglied von 'meta :: select_ag_list ' und tags nicht gefunden, siehe Template bauen stapel. True ?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post