COMPOSABLE C++BEN DEANE / @ben_deane CPPCON 2021 ## I N THIS TALK 1. Composability defined 2. Composable types 3. Objects and patterns 4. Composability at compile time 5. Hierarchies and computation ## COMPOSABLE reusable, extensible, flexible...? Simple? Do we recognize composability when we see it? • STL algorithms? • ranges? ## THE COMPOSABILITY PROBLEM "When I am working on a problem, I never think finished, if the solution is not beautiful, I know it is wrong." -- R. Buckminster Fuller ## COMPOSABILITY LAID BARE "Understanding why software fails is important, but the real challenge is understanding0 码力 | 124 页 | 8.28 MB | 1 年前3
More Ranges PleaseHoekstra ☐ Libraries of similar languages (D, Rust, Java) Barry Revzin. ## • Main Innovation - Composability ☐ Many algorithms take ranges as input and return ranges as output ☐ Opposed to in-place or - ‘expression templates’ ☐ Projections - unary transformations of the ranges we inspect. ## Composability of Ranges • Chaining algorithms due to range arguments and results ranges::reverse(ranges::search(str Libraries can make software better, safer and cleaner - The C++ ranges library is an exemplar of composability - Potential libraries are all around us - it’s not just the STL or written by others - Even0 码力 | 27 页 | 1.08 MB | 1 年前3
Au Unitsb94c/p124_2.jpg) ## Composability Code: Output: ## Composability Code: std::cout << meters(10) << std::endl; Output: 10 m ## Composability Code: std::cout << meters(10) std::endl; std::cout << (meters / second) (20) << std::endl; Output: 10 m 20 m / s ## Composability Code: std::cout << meters(10) << std::endl; std::cout << (meters / second) << (kilo(meters) / hour) (30) << std::endl; Output: 10 m 20 m / s 30 km / h ## Composability Code: std::cout << meters(10) << std::endl; std::cout << (meters / second)0 码力 | 191 页 | 22.37 MB | 1 年前3
Click Documentation Release 1.2.dev0with nesting of commands and composability in a way like click. To the best of the developer's knowledge, click is the first Python library that tries to aim for composability of applications that goes addition to the basic help page to handle the parsing results. Most of all however it makes composability hard. While docopt does support dispatching to subcommands, it for instance does not directly of the first, but it will ignore every value except the first. The reason for this is to allow composability through shell aliases that set defaults. Missing parameters: If a parameter is not defined on0 码力 | 64 页 | 301.16 KB | 2 年前3
Improving Our Safety With a Quantities and Units Library[Image](/uploads/documents/7/0/b/9/70b9ad0cc4d403736e4602a9fa17067c/p140_1.jpg) ## Simple user extensions and composability • Users can always easily add new quantities to existing hierarchies inline constexpr struct *="" isq::width=""> {} horizontal_area; ## Simple user extensions and composability ## • Users can always easily add new quantities to existing hierarchies ## inline constexpr implicitly_convertible(isq::area, horizontal_area)); ## Simple user extensions and composability ## • Users can always easily add new quantities to existing hierarchies inline constexpr struct0 码力 | 207 页 | 6.93 MB | 1 年前3
Click Documentation Release 2.6nesting of commands and composability in a way like click. To the best of the developer's knowledge, click is the first Python library that aims to create a level of composability of applications that addition to the basic help page to handle the parsing results. Most of all, however, it makes composability hard. While docopt does support dispatching to subcommands, it for instance does not directly of the first, but it will ignore every value except the first. The reason for this is to allow composability through shell aliases that set defaults. Missing parameters: If a parameter is not defined on0 码力 | 83 页 | 354.87 KB | 2 年前3
Click Documentation Release 3.3nesting of commands and composability in a way like Click. To the best of the developer's knowledge, Click is the first Python library that aims to create a level of composability of applications that addition to the basic help page to handle the parsing results. Most of all, however, it makes composability hard. While docopt does support dispatching to subcommands, it for instance does not directly of the first, but it will ignore every value except the last. The reason for this is to allow composability through shell aliases that set defaults. Missing parameters: If a parameter is not defined on0 码力 | 95 页 | 387.75 KB | 2 年前3
Click Documentation
Release 4.2.dev0nesting of commands and composability in a way like Click. To the best of the developer's knowledge, Click is the first Python library that aims to create a level of composability of applications that addition to the basic help page to handle the parsing results. Most of all, however, it makes composability hard. While docopt does support dispatching to subcommands, it for instance does not directly of the first, but it will ignore every value except the last. The reason for this is to allow composability through shell aliases that set defaults. Missing parameters: If a parameter is not defined on0 码力 | 101 页 | 407.32 KB | 2 年前3
Click Documentation
Release 6.7nesting of commands and composability in a way like Click. To the best of the developer's knowledge, Click is the first Python library that aims to create a level of composability of applications that addition to the basic help page to handle the parsing results. Most of all, however, it makes composability hard. While docopt does support dispatching to subcommands, it for instance does not directly of the first, but it will ignore every value except the last. The reason for this is to allow composability through shell aliases that set defaults. Missing parameters: If a parameter is not defined on0 码力 | 107 页 | 428.42 KB | 2 年前3
Click Documentation
Release 5.2.dev0nesting of commands and composability in a way like Click. To the best of the developer's knowledge, Click is the first Python library that aims to create a level of composability of applications that addition to the basic help page to handle the parsing results. Most of all, however, it makes composability hard. While docopt does support dispatching to subcommands, it for instance does not directly of the first, but it will ignore every value except the last. The reason for this is to allow composability through shell aliases that set defaults. Missing parameters: If a parameter is not defined on0 码力 | 103 页 | 416.61 KB | 2 年前3
共 30 条
- 1
- 2
- 3













