[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-621461-105":53,"doc-detail-621461-en":126,"doc-similar-621461":148},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":119,"head_meta":121,"extra_data":123,"updated_unix":125},105,"en","cpp-cheat-sheet-by-eskimobrand-insertion-operator-templates-pointers-casting","CPP Cheat Sheet - by eskimobrand - insertion operator, templates, pointers, casting","","CPP Cheat Sheet by eskimobrand consolidates core C++ concepts into compact notes. It contrasts lvalue and rvalue categories, summarizes the role of static members and move semantics, and compares unique_ptr and shared_ptr ownership with reset, get, and move usage. It also covers common STL utilities, functors, templates (including generic copy and max), reference vs pointer differences, dynamic_cast and other casts, lambda capture patterns, and the singleton pattern structure.",{"@graph":63,"@context":118},[64,80,101],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":11,"@type":70,"position":76},"https://docshare.wps.com/template/presentations/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/cpp-cheat-sheet-by-eskimobrand-insertion-operator-templates-pointers-casting/621461/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":95,"encodingFormat":93,"isAccessibleForFree":96,"interactionStatistic":97},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/cpp-cheat-sheet-by-eskimobrand-insertion-operator-templates-pointers-casting/621461.png","ImageObject",442,249,{"name":88,"@type":89},"Aria","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-12-04","2026-10-20",true,{"@type":98,"interactionType":99,"userInteractionCount":79},"InteractionCounter",{"@type":100},"ViewAction",{"@type":102,"mainEntity":103},"FAQPage",[104,110,114],{"name":105,"@type":106,"acceptedAnswer":107},"What is the difference between lvalue and rvalue in this cheat sheet?","Question",{"text":108,"@type":109},"An lvalue is an object that persists beyond a single expression and typically has an address. An rvalue is a temporary value that has no address and can be treated as short-lived.","Answer",{"name":111,"@type":106,"acceptedAnswer":112},"How does move relate to copying in C++ here?",{"text":113,"@type":109},"Move transfers ownership of member variables from another object and is intended to be faster by avoiding unnecessary allocations. It is contrasted with shallow copy and is described as performing similar actions for move assignment.",{"name":115,"@type":106,"acceptedAnswer":116},"When should dynamic_cast be used, and what happens on failure?",{"text":117,"@type":109},"dynamic_cast is used to cast pointers within an inheritance hierarchy for polymorphic types that contain virtual functions. It returns nullptr on failure, and the sheet notes that the const cast uses similar syntax to remove const qualifiers.","https://schema.org",{"og:url":78,"og:type":120,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":122,"canonical":78},"index,follow",{"doc_id":124,"site_id":56},621461,1792465561,{"code":4,"msg":5,"data":127},{"doc_id":124,"user_id":128,"nickname":88,"user_avatar":129,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":130,"file_id":131,"file_url":132,"file_type":133,"file_size":134,"view_count":79,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":73,"language":135,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":136,"faqs":137,"seo_title":138,"seo_description":61,"update_tm":125,"read_time":9,"preview_page_count":73,"preview_urls":139},2336464648322,"https://ap-avatar.wpscdn.com/avatar/2200025388227c56fec?_k=1778556882303663488","CPP Cheat Sheet  \nby eskimobrand [via](via cheatography.com/71842/cs/18220/)[ cheatography.com/71842/cs/18220/](via cheatography.com/71842/cs/18220/)  \nlvalue vs rvalue  \n\n| \u003Cbr>\u003Cbr>object that persists beyond a single expression\u003Cbr>temporary value\u003Cbr>has an address has no address\u003Cbr>\u003Cbr>variable that has a name/const\u003Cbr>increment , decrement\u003Cbr>class members ternary operator\u003Cbr>\u003Cbr>strong literal func call like\u003Cbr>std : :move (x)\u003Cbr>& to reference && to ref\u003Cbr>Statics |\n| --- |\n| \u003Cbr>//Only one copy per class , single resouce can be shared between instances , cant be initialized inside class def 'n\u003Cbr>// static const: can be initialized with an initializer // static constexpr: MUST be initialized with an initializer class X {\u003Cbr>static int m= 5 //err\u003Cbr>static in n ; //ok\u003Cbr>const static int p {5} ;\u003Cbr>constexpr static int arr []= {1 , 3} ;}\u003Cbr>int X : :n= 5 ; //ok\u003Cbr>Move |\n| \u003Cbr>\u003Cbr>takes ownership of member variables from another obj\u003Cbr>faster and avoid mem alloc (unlike copy const'r)\u003Cbr>\u003Cbr>shallow copy\u003Cbr>move assignment does similar |\n\nBy eskimobrand  \n[cheatography.com/eskimobrand/](cheatography.com/eskimobrand/)  \nspecial_ptr  \nclass name { public :  \nname (const char * s) :data {s} { } ; void display_name () { cout \u003C\u003C data;}  \n~name () {} private :  \nstring data;  \n} ;  \nvoid modify_name (name * m) { } int main () {  \nunique_ptr\u003Cname> ptr1 (new name ( \"D \" ) ) ;  \n//Can use - > (and *) on unique_ptr ptr1->display_name () ;  \n// To get raw ptr use get () method modify_name (ptr1 .get ()) ;  \n// Use std::move to transfer unique_ptr\u003Cname> ptr2 (std : :move (ptr1)) ;  \n// assign a new pointer to p tr1 ptr1 .reset (new name ( \"H \" ) ) ;// assign a new pointer to p tr2  \n// D now auto deleted ptr2 .reset (new name ( \" S \" ) ) ;  \n//Use make_shared\u003CT> func to create shared_ptr  \nauto ptr = make_shared\u003Cname>( \"K \" ) ;  \n//ptr and anotherPtr point to K shared_ptr\u003Cname> sptr2=ptr ;  \ncout\u003C\u003Cptr .use_count ()\u003C\u003C \" \\n \" ;// ptr switch to D , K // not deleted sptr2 still holding  \nptr .reset (new name ( \"D \" ) ) ;// S deleted at the end of // this func , ptr2 out of scope}  \nNot published yet.  \nLast updated 10th December , 2018. Page 1 of 2.  \n6 std member functions  \ndefault constructor C () ;  \ncopy c'tor C (const C &) ;  \ncopy-assign C & operator= (const C &) ;  \ndestructor ~ C () ;  \nmove c'tor C (C &&) ;  \nmove assign C & operator= (C &&)  \nInsertion Operator  \nfriend ostream& operator\u003C\u003C (ostream& os , const class& c ) ;  \nAdd Functor  \nstruct add_x { add_x (int x) : x (x) {}  \nint operator () (int y ) const { return x + y; }  \nprivate : int x ;  \n} ;  \n// Now you can use it like this : add_x add42 (42) ; // create an instance  \nint i = add42 (8) ; // and \"call \" it assert (i == 50) ;  \nTemplates  \ntemplate \u003Ctypename T> // Function T get_max (T a , T b) {  \nreturn (a > b ? a : b) ;}  \ndouble max = get_max\u003Cdouble> (m , n) ;// set default type by setting K= string or V= 25  \ntemplate \u003Ctypename K , typename V> class Entry { //Class  \nK key;  \nV value; public :  \nSponsored [by](by CrosswordCheats.com)[ CrosswordCheats.com](by CrosswordCheats.com)[ ](by CrosswordCheats.com)Learn to solve cryptic crosswords!  \n[http://crosswordcheats.com](http://crosswordcheats.com)  \nCPP Cheat Sheet  \nby eskimobrand [via](via cheatography.com/71842/cs/18220/)[ cheatography.com/71842/cs/18220/](via cheatography.com/71842/cs/18220/)  \nTemplates (cont)  \n\n| Entry (K key , V value ) : key {key} , value {value } {}\u003Cbr>} ;\u003Cbr>// Generic Copy Template template\u003Ctypename InIter , typename OutIter>\u003Cbr>OutIter copy ( InIter init , InIter end ,OutIter res) {\u003Cbr>while (init!= end) {\u003Cbr>res++ = init++ ; } return res;} |\n| --- |\n|  |\n| diff between ref and pointer |\n| \u003Cbr>pointer can be null\u003Cbr>pointer can be reassigned\u003Cbr>\u003Cbr>can get address of pointer\u003Cbr>pointers can iterate over array |\n|  |\n| Dynamic cast |\n| \u003Cbr>casts a ptr of one type to a ptr of another type within an inheritance hierarchy\u003Cbr>allows with ptrs and ref to polymorphic types (must contain vir","cbCaieKDyWQWdn3O","https://ap.wps.com/l/cbCaieKDyWQWdn3O","pdf",61724,"English","# lvalue vs rvalue\n# static members and move semantics\n# smart pointers: unique_ptr and shared_ptr\n# std::move and move assignment\n# insertion operator and functors\n# templates and generic algorithms\n# reference vs pointer\n# casting: dynamic_cast, static_cast, const cast\n# common functions: swap and assignment\n# lambda and capture clause\n# singleton","[{\"question\":\"What is the difference between lvalue and rvalue in this cheat sheet?\",\"answer\":\"An lvalue is an object that persists beyond a single expression and typically has an address. An rvalue is a temporary value that has no address and can be treated as short-lived.\"},{\"question\":\"How does move relate to copying in C++ here?\",\"answer\":\"Move transfers ownership of member variables from another object and is intended to be faster by avoiding unnecessary allocations. It is contrasted with shallow copy and is described as performing similar actions for move assignment.\"},{\"question\":\"When should dynamic_cast be used, and what happens on failure?\",\"answer\":\"dynamic_cast is used to cast pointers within an inheritance hierarchy for polymorphic types that contain virtual functions. It returns nullptr on failure, and the sheet notes that the const cast uses similar syntax to remove const qualifiers.\"}]","CPP Cheat Sheet - by eskimobrand - insertion operator, templates, pointers, casting | PDF",[140,144],{"page_no":9,"url":141,"width":142,"height":143},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/24cd6a89c090654f0bc0f7f2e0e42ca4.webp",983,1390,{"page_no":73,"url":145,"width":146,"height":147},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/95463cdf29b6afa5f2a644c56ce2369e.webp",982,1389,{"list":149,"token":60},[150,156,164,170,176,182,188,195,201,207],{"doc_id":151,"doc_title":152,"file_type":133,"home_preview_img_url":153,"slug":154,"view_count":15,"category_name":11,"create_tm":155},573204,"Scala - Cheat Sheet - v.0.1","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229950781808/last/442/249?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796527259&Signature=%2F%2FpR15tIkGBbTsesI4Gj7x8PviQ%3D","scala-cheat-sheet-v01",1791934476,{"doc_id":157,"doc_title":158,"file_type":159,"home_preview_img_url":160,"slug":161,"view_count":162,"category_name":11,"create_tm":163},201077,"Text Integration Utilities (TIU) - Generic HL7 Interface Handbook - Version 1.2","docx","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229882425514/last/442/249?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796527259&Signature=clmcxdIdE5m9gmRDOqsct2ZZDnE%3D","text-integration-utilities-tiu-generic-hl7-interface-handbook-version-12",26,1788519120,{"doc_id":165,"doc_title":166,"file_type":133,"home_preview_img_url":167,"slug":168,"view_count":40,"category_name":11,"create_tm":169},573457,"Blueprint CSS - Version 0.7.1 - CSS layout and style cheat sheet","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229950654811/last/442/249?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796527259&Signature=f9o9PJ4HkZdGAMlqX8Ce5oYzRP8%3D","blueprint-css-version-071-css-layout-and-style-cheat-sheet",1791940073,{"doc_id":171,"doc_title":172,"file_type":133,"home_preview_img_url":173,"slug":174,"view_count":162,"category_name":11,"create_tm":175},572702,"SEARCH OPERATORS - Parsing - Aggregating - Help Docs","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229950583236/last/442/249?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796527259&Signature=s2jNAqEi7NlS7S2%2BRE3WrY%2F84p4%3D","search-operators-parsing-aggregating-help-docs",1791928935,{"doc_id":177,"doc_title":178,"file_type":133,"home_preview_img_url":179,"slug":180,"view_count":30,"category_name":11,"create_tm":181},571696,"R Data Types, Maths Functions, and Core Data Structures - Cheat Sheet","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229950567245/last/442/249?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796527259&Signature=kGQ56B9080QLX76BeZH4tnI33OM%3D","r-data-types-maths-functions-and-core-data-structures-cheat-sheet",1791923170,{"doc_id":183,"doc_title":184,"file_type":133,"home_preview_img_url":185,"slug":186,"view_count":20,"category_name":11,"create_tm":187},237654,"RPP - Core - Updates - Version-00 - Mapping to EPP, Endpoints, and Update Operations","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229893708801/last/442/249?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796527259&Signature=KRkrE3dLAtXM3a%2BKf9%2FyqRobKrs%3D","rpp-core-updates-version-00-mapping-to-epp-endpoints-and-update-operations",1789113993,{"doc_id":189,"doc_title":190,"file_type":133,"home_preview_img_url":191,"slug":192,"view_count":193,"category_name":11,"create_tm":194},571398,"Ubuntu CLI Cheat Sheet - Quick Reference","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229950685100/last/442/249?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796527259&Signature=s0gWqS3rD3SxQBVKzXcDnUu7L18%3D","ubuntu-cli-cheat-sheet-quick-reference",23,1791915351,{"doc_id":196,"doc_title":197,"file_type":133,"home_preview_img_url":198,"slug":199,"view_count":15,"category_name":11,"create_tm":200},563712,"Recipe for a Gantt chart - create a Gantt chart in QlikView","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229948527778/last/442/249?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796527259&Signature=2cGlb1%2Fs%2Boz6k7O2RxA2VHSu8ts%3D","recipe-for-a-gantt-chart-create-a-gantt-chart-in-qlikview",1791837840,{"doc_id":202,"doc_title":203,"file_type":133,"home_preview_img_url":204,"slug":205,"view_count":193,"category_name":11,"create_tm":206},572972,"boogie_windows-command-line-basic - Windows Command Line Basic Cheat Sheet","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229950750685/last/442/249?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796527259&Signature=5hhUJJeVkv4keTPC6YvbtrQ4FWo%3D","boogie_windows-command-line-basic-windows-command-line-basic-cheat-sheet",1791930318,{"doc_id":208,"doc_title":209,"file_type":133,"home_preview_img_url":210,"slug":211,"view_count":212,"category_name":11,"create_tm":213},381417,"Fulbright Fellow Handbook - Handbook 2026 - 2027 - Pre-departure & Arrival","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229915573888/last/442/249?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796527259&Signature=CRWwnBwa0uR%2Bdr7w8316I8QJBSw%3D","fulbright-fellow-handbook-2026-2027-pre-departure-arrival",13,1790245198]