xref: /aosp_15_r20/external/cronet/base/functional/README.md (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1*6777b538SAndroid Build Coastguard Worker# base/functional library
2*6777b538SAndroid Build Coastguard Worker
3*6777b538SAndroid Build Coastguard Worker[TOC]
4*6777b538SAndroid Build Coastguard Worker
5*6777b538SAndroid Build Coastguard Worker## What goes here
6*6777b538SAndroid Build Coastguard Worker
7*6777b538SAndroid Build Coastguard WorkerThis directory contains function objects from future STL versions and closely
8*6777b538SAndroid Build Coastguard Workerrelated types.
9*6777b538SAndroid Build Coastguard Worker
10*6777b538SAndroid Build Coastguard WorkerThings should be moved here that are generally applicable across the code base.
11*6777b538SAndroid Build Coastguard WorkerDon't add things here just because you need them in one place and think others
12*6777b538SAndroid Build Coastguard Workermay someday want something similar. You can put specialized function objects in
13*6777b538SAndroid Build Coastguard Workeryour component's directory and we can promote them here later if we feel there
14*6777b538SAndroid Build Coastguard Workeris broad applicability.
15*6777b538SAndroid Build Coastguard Worker
16*6777b538SAndroid Build Coastguard Worker### Design and naming
17*6777b538SAndroid Build Coastguard Worker
18*6777b538SAndroid Build Coastguard WorkerFundamental [//base principles](../README.md#design-and-naming) apply, i.e.:
19*6777b538SAndroid Build Coastguard Worker
20*6777b538SAndroid Build Coastguard WorkerFunction objects should either come directly from the STL or adhere as closely
21*6777b538SAndroid Build Coastguard Workerto STL as possible. Functions and behaviors not present in STL should only be
22*6777b538SAndroid Build Coastguard Workeradded when they are related to the specific function objects.
23*6777b538SAndroid Build Coastguard Worker
24*6777b538SAndroid Build Coastguard WorkerFor STL-like function objects our policy is that they should use STL-like naming
25*6777b538SAndroid Build Coastguard Workereven when it may conflict with the style guide. So functions and class names
26*6777b538SAndroid Build Coastguard Workershould be lower case with underscores. Non-STL-like classes and functions should
27*6777b538SAndroid Build Coastguard Workeruse Google naming. Be sure to use the base namespace.
28