Object Lifetime: From Start to FinishdoSomethingElse(); int main() { doSomething(Foo(1), Foo(2).m_i, Foo(3).getBar(), string("World").c_str()), doSomethingElse(); } 1 2 3 4 5 6 7 8 9 10 11 12 13 138 https://godbolt.org/z/nvY6EbTjsstruct doSomethingElse(); int main() { doSomething(Foo(1), Foo(2).m_i, Foo(3).getBar(), string("World").c_str()), doSomethingElse(); } 1 2 3 4 5 6 7 8 9 10 11 12 13 139 https://godbolt.org/z/nvY6EbTjsstruct doSomethingElse(); int main() { doSomething(Foo(1), Foo(2).m_i, Foo(3).getBar(), string("World").c_str()), doSomethingElse(); } 1 2 3 4 5 6 7 8 9 10 11 12 13 140 https://godbolt.org/z/nvY6EbTjsstruct0 码力 | 214 页 | 9.34 MB | 6 月前3
Reflection Is Not Contemplationproperty(class_builder& b, type type, std::string name) -> void { auto member_name = identifier{("m_" + name).c_str()}; append_field(b, member_name, type); method_prototype mp; object_type(mp, make_const(decl_of(b))); return_type(mp, make_lvalue_reference(make_const(type))); append_method(b, identifier{("get_" + name).c_str()}, mp, [member_name](method_builder& b){ append_return(b, make_field_expr( make_dere object_type(mp1, decl_of(b)); return_type(mp1, ^void); append_method(b, identifier{("set_" + name).c_str()}, mp1, [member_name](method_builder& b){ append_expr(b, make_operator_expr(0 码力 | 45 页 | 2.45 MB | 6 月前3
Practical memory pool based allocators for Modern C++runOnFunction(llvm::Function & f) override { const auto pretty_name = boost::core::demangle(f.getName().str().c_str()); static const std::regex call_regex{R"(void instrument::type_reg<([^,]+),(.+),([^,]+)>\(\))"}; const auto pool_id = std::atoi(match[1].str().c_str()); const auto type = match[2].str(); const auto size = std::atoi(match[3].str().c_str()); std::cout << "Pool ID: " << pool_id0 码力 | 49 页 | 986.95 KB | 6 月前3
Unraveling string_view: Basics, Benefits, and Best Practices<< sv << '\n'; name_ name• Some other methods in string which are not present in string_view • c_str: Since string_view cannot provide null terminated string guarantee. • capacity: No need, since there takeways 57 If you have a const std::string convert that to std::string_view. const std::string c_str{"hello"}; static constexpr std::string_view kStr{"hello"}; If you have a non-constructor function char*, then please: • Keep in mind that data() for string_view does not behave the same way that c_str() does for string. Always assume that it does not end with ‘\0’. • Check whether its empty() before0 码力 | 61 页 | 1.11 MB | 6 月前3
Tracy: A Profiler You Don't Want to Missnt_thread_index(); tracy::SetThreadName(std::string("tbb worker #").append(std::to_string(tid)).c_str()); } } void on_scheduler_exit(bool is_worker) override { } }; 50 Tips & Tricks0 码力 | 84 页 | 8.70 MB | 6 月前3
Tracy: A Profiler You Don't Want to Missnt_thread_index(); tracy::SetThreadName(std::string("tbb worker #").append(std::to_string(tid)).c_str()); } } void on_scheduler_exit(bool is_worker) override { } }; 50 Tips & Tricks0 码力 | 85 页 | 6.51 MB | 6 月前3
Extending and Simplifying C++: Thoughts on Pattern Matching using 'is' and 'as', and Can C++ be 10x Simpler & Safer?auto myfile {fopen("xyzzy", "w")}; CPP2_UFCS(fprintf, myfile, "Hello %s with UFCS!” , CPP2_UFCS_0(c_str, std::move(s))); CPP2_UFCS_0(fclose, std::move(myfile)); 102UFCS - the beginning #define CPP2_UFCS(FUNCNAME0 码力 | 108 页 | 5.08 MB | 6 月前3
A Physical Units Library for the Next C++[[nodiscard]] constexpr std::size_t size() const noexcept; [[nodiscard]] constexpr const CharT* c_str() const noexcept; [[nodiscard]] constexpr const CharT& operator[](std::size_t index) const noexcept;0 码力 | 172 页 | 6.17 MB | 6 月前3
The Idris Tutorial Version 0.99E R 5. L A N G U A G E R E F E R E N C E v0. 99 public export data C_Types : Type -> Type where C_Str : C_Types String C_Float : C_Types Double C_Ptr : C_Types Ptr C_MPtr : C_Types ManagedPtr C_Unit t h e f ol l ow i n g i m p l i c i t p r oof as t h e fty ar gu m e n t t o foreign: FFun C_Str (FFun C_Str (FRet C_Ptr)) 5. 5. 4 C om p i l i n g f or e i gn c al l s ( T h i s s e c t i on as s u t h e LExp f or m as : LForeign (FStr "fileOpen") (FCon (sUN "C_Ptr")) [(FCon (sUN "C_Str"), f), (FCon (sUN "C_Str"), m)] ( As s u m i n g t h at f an d m s t an d f or t h e LExp r e p r e s e n t at0 码力 | 182 页 | 1.04 MB | 1 年前3
Idris 语言文档 Version 1.3.1t -> C_FnTypes t ||| Supported C foreign types public export data C_Types : Type -> Type where C_Str : C_Types String C_Float : C_Types Double C_Ptr : C_Types Ptr C_MPtr : C_Types ManagedPtr C_Unit 版 版 版本 本 本 1. 3. 1 奩 奭 奰 奬 奩 奣 奩 奴 奰 奲 奯奯奦 奡女 奴 奨 奥 fty 奡奲 奧奵 奭 奥 奮 奴 奴 奯 foreign夺 FFun C_Str (FFun C_Str (FRet C_Ptr)) 6. 5. 5 C om p i l i n g f or e i gn c al l s 夨 奔 奨 奩 女 女 奥 奣 奴 奩 奯奮 奡女 女 奵 奴 奨 奥 LExp 奦 奯奲 奭 奡女 夺 LForeign (FStr "fileOpen") (FCon (sUN "C_Ptr")) [(FCon (sUN "C_Str"), f), (FCon (sUN "C_Str"), m)] 夨 奁女 女 奵 奭 奩 奮 奧 奴 奨 奡奴 f 奡奮 奤 m 女 奴 奡奮 奤 奦 奯奲 奴 奨 奥 LExp 奲 奥 奰 奲 奥 女 奥 奮 奴 奡奴0 码力 | 224 页 | 2.06 MB | 1 年前3
共 94 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
相关搜索词
ObjectLifetimeFromStarttoFinishReflectionIsNotContemplationPracticalmemorypoolbasedallocatorsforModernC++UnravelingstringviewBasicsBenefitsandBestPracticesTracyProfilerYouDonWantMissExtendingSimplifyingThoughtsonPatternMatchingusingisasCanbe10xSimplerSaferPhysicalUnitsLibrarytheNextTheIdrisTutorialVersion0.99函数式编程语言HaskellOCaml













