{"id":4947,"date":"2021-04-28T09:22:52","date_gmt":"2021-04-28T08:22:52","guid":{"rendered":"http:\/\/roboblog.fatal-fury.de\/?p=4947"},"modified":"2021-04-28T09:22:52","modified_gmt":"2021-04-28T08:22:52","slug":"c-guns-mit-concepts-zur-compilezeit-testen-ob-ein-enum-ein-bestimmten-enumerator-hat","status":"publish","type":"post","link":"http:\/\/roboblog.fatal-fury.de\/?p=4947","title":{"rendered":"C++ Guns: mit concepts zur Compilezeit testen, ob ein enum ein bestimmten enumerator hat"},"content":{"rendered":"<p>Ja concepts sind schon toll ;)<\/p>\n<p>Gr\u00fc\u00dfe an euIRCnet #c++<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nenum class A {aa, bb};\r\nenum class B {bb};\r\nenum class C {aa, bb};\r\n\r\n\r\ntemplate&lt;typename T&gt;\r\nstruct Isso {\r\n    const static bool value = false;\r\n};\r\n\r\n\r\ntemplate&lt;typename T&gt;\r\nrequires T::aa == T::aa\r\nstruct Isso&lt;T&gt; {\r\n    const static bool value = true;\r\n};\r\n\r\n\r\nstatic_assert(Isso&lt;A&gt;::value);\r\nstatic_assert(Isso&lt;B&gt;::value == false);\r\nstatic_assert(Isso&lt;C&gt;::value);\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Ja concepts sind schon toll ;) Gr\u00fc\u00dfe an euIRCnet #c++ enum class A {aa, bb}; enum class B {bb}; enum class C {aa, bb}; template&lt;typename T&gt; struct Isso { const static bool value = false; }; template&lt;typename T&gt; requires T::aa == T::aa struct Isso&lt;T&gt; { const static bool value = true; }; static_assert(Isso&lt;A&gt;::value); static_assert(Isso&lt;B&gt;::value == [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[17],"class_list":["post-4947","post","type-post","status-publish","format-standard","hentry","category-allgemein","tag-cpp"],"_links":{"self":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/4947","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4947"}],"version-history":[{"count":2,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/4947\/revisions"}],"predecessor-version":[{"id":4949,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/4947\/revisions\/4949"}],"wp:attachment":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4947"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}