Back to Basics: Concurrencystd::vectortokens_; Token getToken() { mtx_.lock(); if (tokens_.empty()) tokens_.push_back(Token::create()); Token t = std::move(tokens_.back()); tokens_.pop_back(); facilities of the bathroom itself. TokenPool’s mtx_ protects its vector tokens_. Every access (read or write) to tokens_ must be done under a lock on mtx_. This is an invariant that must be preserved getToken() { mtx_.lock(); if (tokens_.empty()) tokens_.push_back(Token::create()); Token t = std::move(tokens_.back()); tokens_.pop_back(); mtx_.unlock(); 0 码力 | 58 页 | 333.56 KB | 6 月前3
 Reflection Is Not ContemplationSequences Status: prototype implementation constexpr auto t1 = ^^{ a + /* hi! */ b }; // three tokens static_assert(std::is_same_v); constexpr auto t2 = ^^{ a += ( }; constexpr auto strings and integrals, creates an identifier • \tokens( expr ) expands another token sequence •Inside any consteval function: • queue_injection( tokens_expr ) injects a token sequence into the current // Same as: int x = 42; typename[:^char:] c = '*'; // Same as: char c = '*';Angle of Attack Tokens, tokens everywhere… •P3294 (Injection with Token Sequences) a game changer for generation • Lennon/McCartney 0 码力 | 45 页 | 2.45 MB | 6 月前3
 Peering Forward: C++'s Next Decadename = identifier_of(proto); queue_injection(^^{ class \id(name) { public: \tokens(make_interface_functions(proto)) virtual ~\id(name)() = default; \id(name)() = default; \id(name)(\id(name) (is_nonspecial_member_function(mem)) { ret = ^^{ \tokens(ret) virtual [:\(return_type_of(mem)):] \id(identifier_of(mem)) (\tokens(parameter_list_of(mem))) = 0; }; }0 码力 | 84 页 | 6.21 MB | 6 月前3
 Expressive Compile-time Parsersfunctions, types, treesParser In a compiler: tokens -> parser -> syntax tree In a web browser: text -> JSON parser -> JS object parse(text or tokens) -> value or errorParser Combinators Create a stream #[proc_macro] pub fn my_macro(input: TokenStream) -> TokenStream { /*...*/ } my_macro!(tokens); #[derive(Clone, Debug, my_macro)] struct MyStruct;Rust Macros – Overview Macro rules matches a0 码力 | 134 页 | 1.73 MB | 6 月前3
 Neighborhoods Banding Together: Reasoning Globally about Programsuse the same sequence of tokens. They must generally refer to the same other entities. Sometimes they may refer to different constants with the same value. Linkage name: tokens, values, linkage namesLorem0 码力 | 49 页 | 1.03 MB | 6 月前3
 Back to Basics: The structure of a ProgramPhase 5 Phase 6 Phase 7 Phase 8 Phase 9 • the source file is decomposed into preprocessing tokens, sequences of whitespace characters, and comments • each comment is replaced by one whitespace Phase 7 Phase 8 Phase 9 • each preprocessing token is converted into a token • the resulting tokens are syntactically and semantically analyzed and translated as a translation unitCopyright © 20200 码力 | 64 页 | 390.34 KB | 6 月前3
 Working with Asynchrony Generically: A Tour of C++ Executorsreceiver … time passes… 74 Some senders have stop sources. “I’ll do my best!” They pass stop tokens to the operation state. Cancellation details are internal to algorithms. “Hey, receiver! I’ve THREE-WAY HANDSHAKE OpState Caller Receiver “Please stop.” “I’ve stopped.”76 SENDERS PASS STOP TOKENS TO CHILDREN VIA RECEIVERS when_all then then then schedule schedule schedule connect X 3 stop_source0 码力 | 121 页 | 7.73 MB | 6 月前3
 Conan 1.19 Documentationserver authorization is done with JWT. jwt_secret is a random string used to generate authentication tokens. You can change it safely anytime (in fact it is a good practice). The change will just force users value disk_authorize_timeout is not currently used. File trans- fers are authorized with their own tokens, generated with the secret updown_secret. This value should be different from the above jwt_secret user optional arguments: -h, --help show this help message and exit -c, --clean Remove user and tokens for all remotes -p [PASSWORD], --password [PASSWORD] User password. Use double quotes if password0 码力 | 609 页 | 4.88 MB | 1 年前3
 Conan 1.20 Documentationserver authorization is done with JWT. jwt_secret is a random string used to generate authentication tokens. You can change it safely anytime (in fact it is a good practice). The change will just force users value disk_authorize_timeout is not currently used. File trans- fers are authorized with their own tokens, generated with the secret updown_secret. This value should be different from the above jwt_secret user optional arguments: -h, --help show this help message and exit -c, --clean Remove user and tokens for all remotes -p [PASSWORD], --password [PASSWORD] User password. Use double quotes if password0 码力 | 611 页 | 4.89 MB | 1 年前3
 Conan 1.31 Documentationserver authorization is done with JWT. jwt_secret is a random string used to generate authentication tokens. You can change it safely anytime (in fact it is a good practice). The change will just force users value disk_authorize_timeout is not currently used. File trans- fers are authorized with their own tokens, generated with the secret updown_secret. This value should be different from the above jwt_secret user optional arguments: -h, --help show this help message and exit -c, --clean Remove user and tokens for all remotes -p [PASSWORD], --password [PASSWORD] User password. Use double quotes if password0 码力 | 721 页 | 5.41 MB | 1 年前3
共 85 条
- 1
 - 2
 - 3
 - 4
 - 5
 - 6
 - 9
 













