void foo(constexpr int x)
{
// foo() is a function template with a hidden invented template parameter naming a unique type
if constexpr ( consteval(x) )
{
// Should be legal in this scope
std::bitset<x> z;
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <cell/sysmodule.h> | |
#include <sysutil/sysutil_sysparam.h> | |
#include <sysutil/sysutil_msgdialog.h> | |
#include <sysutil/sysutil_syscache.h> | |
#include <sys/paths.h> | |
#include <cell/cell_fs.h> |
// Helper template | |
template <auto V> | |
struct const_value | |
{ | |
static constexpr auto value = V; | |
constexpr operator decltype(V)() const noexcept | |
{ | |
return V; | |
} |
Bound class - a class that has direct access to non-static members of some outer class and knows its own location within this outer class. Whether it can access private or protected members of the outer class, is governed by existing friendship rules. The only proposed way a bound class can be defined and instantiated is through a bound class template. Non-template bound classes are not proposed.
Outer class - a class that has a member or a base class which is a bound class. An outer class itself can be a bound class, or a normal class. This term does not imply anything special.
Bound class template - a class template whose template parameter list has a special parameter, with special syntax. The presence of this template parameter turns a normal class template into a bound class template.
// Helper type to examine pointers to members | |
template <typename MemPtrType> | |
struct memptr_traits | |
{ | |
static_assert(std::is_member_pointer_v<MemPtrType>, "Not a member pointer"); | |
}; | |
// Pointer to data member specialization | |
template <typename Base, typename Type> | |
struct memptr_traits<Type Base::*> |
std::string CgBinaryDisasm::FormatDisAsm(const std::string& code) | |
{ | |
const std::pair<std::string, std::function<std::string()>> repl_list[] = | |
{ | |
{ "$$", [this]{ return "$"; } }, // may require std::string("$") | |
{ "$0", [this]{ return GetSrcDisAsm<SRC0>(src0); } }, | |
{ "$1", [this]{ return GetSrcDisAsm<SRC1>(src1); } }, | |
{ "$2", [this]{ return GetSrcDisAsm<SRC2>(src2); } }, | |
{ "$t", [this]{ return AddTexDisAsm(); } }, | |
{ "$m", [this]{ return GetMask(); } }, |