NativeScript 101Write once by default. Target specific platform capabilities when needed. Styling with CSS CSS Convention: app.css <-- Global styles [viewName].css <-- View styles [viewName]. [platform].css Supported0 码力 | 90 页 | 40.11 MB | 1 年前3
Working with Asynchrony Generically: A Tour of C++ ExecutorsRECEIVER set_value(values... ) set_error(error ) set_done() Operation state notifies receiver by calling one of these exactly once.23 CONCEPTUAL BUILDING BLOCKS OF P2300 concept scheduler: schedule(scheduler) from with_awaitable_senders.46 COROUTINES AND CANCELLATION • If an awaited sender completes by calling set_done(), it behaves as though an uncatchable “exception” has been thrown. (The stack of awaiting ex::on(workers.get_scheduler(), process_request(request)); } } If accept_request() completes by calling set_done(), the rest of the coroutine doesn’t execute.48 EXAMPLE: LAUNCHING CONCURRENT WORK0 码力 | 121 页 | 7.73 MB | 6 月前3
Making Libraries Consumable for Non-C++ DevelopersDon’t touch it! Glue code? Boiler plate? A nightmare? Application binary interface (ABI) Calling conventions Marshalling Was I supposed to free that? Was I not supposed to free that? Enabling */ data_t get_data_from(size_t dev); What defines how dev is passed or data_t is returned? Calling conventions… sigh. Which one is being used here? push ... call data_t get_data_from(unsigned same as “width”. Explicitly state/document/reference function conventions. • Defining a macro for calling conventions is a great start. For example, MYLIB_CCONV. • Reference: llvm - CallingConv.h • Don’t0 码力 | 29 页 | 1.21 MB | 6 月前3
C++20 STL Features: 1 Year of Development on GitHuberase-remove idiom • list-like: remove/remove_if member functions • map-like: handwritten loop calling m.erase(iter) • Many potential hazards 🙀 • remove_if(v.begin(), v.end(), pred); 🐞 • v.erase(remove_if(v0 码力 | 45 页 | 702.09 KB | 6 月前3
hazard pointer synchronous reclamationUser calls hazard_pointer_clean_up. • A is reclaimed. B is automatically retired (as a result of calling hazard_pointer_clean_up). • Resource X is shutdown. • B is not yet reclaimed. Counted link Solutions0 码力 | 31 页 | 856.38 KB | 6 月前3
C++20: An (Almost) Complete Overviewco_yield: returns a value from a coroutine to the caller, and suspends the coroutine, subsequently calling the coroutine again continues its execution co_return: returns from a coroutine (just return0 码力 | 85 页 | 512.18 KB | 6 月前3
共 6 条
- 1













