Blame view

3rdparty/boost_1_81_0/libs/optional/README.md 393 Bytes
73ef4ff3   Hu Chunming   提交三方库
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  optional
  ========
  
  A library for representing optional (nullable) objects in C++.
  
  ```cpp
  optional<int> readInt(); // this function may return either an int or a not-an-int
  
  if (optional<int> oi = readInt()) // did I get a real int
    cout << "my int is: " << *oi;   // use my int
  else
    cout << "I have no int";
  ```
  
  For more information refer to the documentation provided with this library.