67 using BasicallyCString = std::is_convertible<T, const char*>;
70 #define SHOW_CHECK(_EXPR_) cout << STRINGIFY(_EXPR_) << "\t : " << (_EXPR_::value? "Yes":"No") << endl; 71 #define ANALYSE(_TYPE_) \ 72 cout << "Type: " STRINGIFY(_TYPE_) " ......"<<endl; \ 73 SHOW_CHECK (is_StringLike<_TYPE_>); \ 74 SHOW_CHECK (BasicallyString<_TYPE_>); \ 75 SHOW_CHECK (BasicallyCString<_TYPE_>); \ 76 SHOW_CHECK (std::is_arithmetic<_TYPE_>); \ 77 SHOW_CHECK (can_lexical2string<_TYPE_>); \ 78 SHOW_CHECK (can_convertToString<_TYPE_>); \ 79 SHOW_CHECK (use_StringConversion4Stream<_TYPE_>); 85 using CharLit = decltype(
"literal");
86 using CharPtr =
const char*;
87 using StringPtr =
string *;
88 using StringRef =
string &;
89 using StringRRef =
string &&;
90 using StrConstRef =
string const&;
102 ANALYSE (StringRRef);
103 ANALYSE (StrConstRef);
111 ANALYSE (GenNodeRRef)
113 cout <<
"───────────────────────────╼━━━━━━━━━━╾───────────────────────────"<<endl;
148 auto silent = makeP<Reticent>();
149 auto chatty = makeP<GenNode>(
"Hui",
"Buh");
151 cout <<
"smart-ptr, no string conv..." << silent <<endl;
152 cout <<
"smart-ptr, custom conv......" << chatty <<endl;
154 cout <<
"reference, no string conv..." << *silent <<endl;
155 cout <<
"reference, custom conv......" << *chatty <<endl;
156 cout <<
"pointer, custom conv......" << chatty.get() <<endl;
159 cout <<
"smart-ptr, NULL pointee....." << chatty <<endl;
160 cout <<
"pointer, NULL pointee....." << chatty.get() <<endl;
Customised refcounting smart pointer.
Simple test class runner.
Generic building block for tree shaped (meta)data structures.
Helpers for type detection, type rewriting and metaprogramming.
P< X > makeP(ARGS &&... ctorArgs)
Helper to create and manage by lib::P.
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
generic data element node within a tree