C++20 镶 SQLC++20 ❤ SQL John R Bandela, MDOverview u SQL u C++ Example u Implementation techniques u fixed_string u meta_struct u Parsing compile time strings into meta_structsOverview v SQL v C++ Example {price_from_user};Avoiding SQL Injection Attacks SELECT orders.id, name, item, price, discount_code FROM orders JOIN customers ON customers.id = customerid WHERE price > ?;SQL Library Options u Traditional Lots of information available u Vulnerable to sql injection of developer not careful u Use dynamic typingDomain Specific Language u Use types to encode SQL u Looks more like regular C++ u Typically requires0 码力 | 46 页 | 775.02 KB | 6 月前3
Back to Basics: Debugging Techniquesoutput describing the program state during execution • In simpler cases, instrument code with print statements • In more complex systems, take advantage of existing logging facilities • Comments • Great callgrind, helgrind, ...) • Call tracers and domain-specific diagnostic tools (strace, wireshark, SQL analyzers...) • Comments • Very powerful tools for deterministic problems • Not always useful for callgrind, helgrind, ...) • Call tracers and domain-specific diagnostic tools (strace, wireshark, SQL analyzers...) 42CppCon 2021 – Back to Basics: Debugging Techniques Copyright © 2021 Bob Steagall0 码力 | 44 页 | 470.68 KB | 6 月前3
Back to Basics: The Abstract Machine- Threads • What does it mean to invoke and execute a function? • Functions consist of statements • Statements consist of expressions • An expression is a sequence of operators and operands that specifies I N G Structure of the Abstract Machine – Threads and Expressions • Functions consist of statements, statements consist of expressions • An expression is a sequence of operators and operands that specifies0 码力 | 91 页 | 538.90 KB | 6 月前3
Peering Forward: C++'s Next Decadetry/catch, vector/string, … lambdas, constexpr destructors, if constexpr, static_assert, … more statements, local variables, if/switch, for/while, member functions, … one return statement C++ 23 C++ CTAD, structured bindings, … lambdas, range-for, variadic templates, static_assert, … more statements, local variables, if/switch, for/while, … throw a few instructions at a pixel as it flies by try/catch, vector/string, … lambdas, constexpr destructors, if constexpr, static_assert, … more statements, local variables, if/switch, for/while, member functions, … one return statement C++ 23 C++0 码力 | 84 页 | 6.21 MB | 6 月前3
COMPOSABLE C++way - Put another way - We should strive to put We should strive to put if if statements in two places only: statements in two places only: at the bottom of the stack (built into data structure) at When working in a collection, stay in the collection. Conditions inhibit composition: avoid raw if statements. Compile-time capability is still in its infancy (if constexpr is not better than SFINAE). The0 码力 | 124 页 | 8.28 MB | 6 月前3
A New Decade of Visual Studio: C++20, Open STL and MoreCore Checkers in MSVC Code Analysis • Missing default label in switch statements • Unannotated fall through in switch statements • Expensive range-for copy • Expensive copy with the auto keyword Tue0 码力 | 37 页 | 2.67 MB | 6 月前3
Modern C++ Tutorial: C++11/14/17/20 On the Flyfibonacci(n-1) + fibonacci(n-2); } Starting with C++14, the constexpr function can use simple statements such as local variables, loops, and branches internally. For example, the following code cannot for statement, but there is always no way to declare a temporary variable in the if and switch statements. E.g: #include#include #include int main() { std::vector derivation. At this point, we can answer the question: Why is auto&& the safest way to use looping statements? Because when auto is pushed to a different lvalue and rvalue reference, the collapsed combination 0 码力 | 92 页 | 1.79 MB | 1 年前3
Can You RVO?returned 36© 2018 Bloomberg Finance L.P. All rights reserved. When there are multiple return statements returning different objects (for NRVO only) 37© 2018 Bloomberg Finance L.P. All rights reserved the current function’s scope ● Return type doesn’t match function signature ● Multiple return statements (NRVO only) ● Returning complex expressions that are not vanilla lvalue & prvalues ● Using0 码力 | 84 页 | 9.98 MB | 6 月前3
Scientific Unit Testingwould like to 1. make statements that can be proven true or false 2. Prove them true or false But generally you can't prove them true You can do the next best thing: 1. make statements that can be proven0 码力 | 45 页 | 1.91 MB | 6 月前3
Tracy: A Profiler You Don't Want to Misscritical 3%." The Obligatory Quote Donald E. Knuth. 1974. Structured Programming with go to Statements. ACM Computing Surveys 6, 4 (Dec. 1974), 261–301.“There is no doubt that the grail of efficiency opportunities in that critical 3%." Donald E. Knuth. 1974. Structured Programming with go to Statements. ACM Computing Surveys 6, 4 (Dec. 1974), 261–301. The Obligatory Quote, in proper contexthttps://www0 码力 | 84 页 | 8.70 MB | 6 月前3
共 94 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10













