Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
cache_node.cc
//g++ 5.4.0 #include <iostream> #include <string> #include <memory> #include <stddef.h> using namespace std; #define MEMB_SIZE(t,m) (sizeof(((t*)0)->m)) class A { public: A() {}; virtual ~A() {}; int a; int b; uint64_t c; }; class Node { public: uint64_t* prev; uint64_t* next; uint64_t* list; }; class B { public: B() {std::cout << "cons" << std::endl;}; ~B() {std::cout << " des" << std::endl;}; uint64_t* a; uint64_t* b; uint64_t e; uint32_t c; uint8_t f; enum CacheState : uint8_t { NONE, INACTIVE, ACTIVE, WRITING_BACK, ACCESSED_AFTER_WRITING_BACK, CLEAN}; class NodeCtx { Node node; }; CacheState stat; NodeCtx g; }; enum CacheEnum : uint8_t { NONE, INACTIVE, ACTIVE, WRITING_BACK, ACCESSED_AFTER_WRITING_BACK, CLEAN}; int main() { //std::cout << offsetof(A, a) << " " << offsetof(A, b) << " " << offsetof(A, c); std::cout << " " << sizeof(B) << " " << offsetof(B, g) << " " << sizeof(CacheEnum); }
run
|
edit
|
history
|
help
0
Date n Time Macros
Conjuntos - Contar caracteres únicos
Tubee c++
LIS
test if nullptr
HashFold
member initial list
PhoneDirectory
Backpack with recursion
СПКИ АП КЭП 3