]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/d/dmd/root/optional.h
4 * Optional implementation.
6 * Copyright: Copyright (C) 1999-2021 by The D Language Foundation, All Rights Reserved
7 * Authors: $(LINK2 http://www.digitalmars.com, Walter Bright)
8 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
9 * Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/root/optional.h, root/_optional.h)
10 * Documentation: https://dlang.org/phobos/dmd_root_optional.html
11 * Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/root/optional.h
14 /// Optional type that is either `empty` or contains a value of type `T`
19 /** the value (if present) **/
22 /** whether `value` is set **/
26 /** Creates an `Optional` with the given value **/
29 /** Creates an `Optional` with the given value **/
30 static Optional
<T
> create(T
);
32 /** Checks whether this `Optional` contains a value **/
33 bool isPresent() const;
35 /** Checks whether this `Optional` does not contain a value **/
38 /** Returns: The value if present **/
41 bool hasValue(const T
) const;