Iteration RevisitedIdea: generalise iteration by index, rather than by pointer 24ITERATION REVISITED FLUX ▸ Flux (github.com/tcbrindle/flux) is a C++20 library exploring these ideas ▸ Aims: ▸ Much improved safety by default ITERATION OPERATIONS WITH FLUX ▸ flux�::first(seq) returns a cursor, which represents a sequence position ▸ For contiguous sequences, this is just an integer index ▸ flux�::is_last(seq, cur) returns the cursor is past-the-end ▸ flux�::read_at(seq, cur) accesses the element at the cursor position ▸ flux�::inc(seq, cur) increments the cursor 26ITERATION REVISITED FLUX CONCEPTS ▸ A type which provides0 码力 | 56 页 | 5.27 MB | 6 月前3
C++20 Modules: The Packaging and Binary Redistribution Storyof the importers import fmt; fmt.cxx fmt.pcm fmt.oCompilation time #include <flux.hpp> took 319 ms import flux; took 14 msYour imports (can) have imports export module foo; import bar; the gate for a mechanical issue compilation terminated.BMI compatibility (cont’d) add_subdirectory(flux) add_subdirectory(fmt) add_subdirectory(argparse) add_library(foo) target_sources(foo PUBLIC foo fmt::fmt flux::flux argparse::argparse) /lib/llvm-16/bin/clang++ -I/usr/lib/gcc/aarch64-linux-gnu/12/include -I/cxx-modules/cmake-example/fmt/include -I/cxx-modules/cmake-example/flux/include -O30 码力 | 76 页 | 2.09 MB | 6 月前3
共 2 条
- 1













