---
title: llarp::config

---

# llarp::config



## Classes

|                | Name           |
| -------------- | -------------- |
| struct | **[llarp::config::option_flag](Classes/structllarp_1_1config_1_1option__flag.md)**  |
| struct | **[llarp::config::Required_t](Classes/structllarp_1_1config_1_1Required__t.md)**  |
| struct | **[llarp::config::Hidden_t](Classes/structllarp_1_1config_1_1Hidden__t.md)**  |
| struct | **[llarp::config::MultiValue_t](Classes/structllarp_1_1config_1_1MultiValue__t.md)**  |
| struct | **[llarp::config::RelayOnly_t](Classes/structllarp_1_1config_1_1RelayOnly__t.md)**  |
| struct | **[llarp::config::ClientOnly_t](Classes/structllarp_1_1config_1_1ClientOnly__t.md)**  |
| struct | **[llarp::config::Deprecated_t](Classes/structllarp_1_1config_1_1Deprecated__t.md)**  |
| struct | **[llarp::config::Default](Classes/structllarp_1_1config_1_1Default.md)** <br>Wrapper to specify a default value to an [OptionDefinition](Classes/structllarp_1_1OptionDefinition.md).  |
| struct | **[llarp::config::Comment](Classes/structllarp_1_1config_1_1Comment.md)** <br>Adds one or more comment lines to the option definition.  |

## Types

|                | Name           |
| -------------- | -------------- |
| template <typename T \> <br>using std::remove_cv_t< std::remove_reference_t< T > > | **[remove_cvref_t](Namespaces/namespacellarp_1_1config.md#using-remove-cvref-t)**  |

## Functions

|                | Name           |
| -------------- | -------------- |
| template <typename T \> <br>auto | **[AssignmentAcceptor](Namespaces/namespacellarp_1_1config.md#function-assignmentacceptor)**(T & ref)<br>A convenience function that returns an acceptor which assigns to a reference.  |

## Attributes

|                | Name           |
| -------------- | -------------- |
| constexpr [Required_t](Classes/structllarp_1_1config_1_1Required__t.md) | **[Required](Namespaces/namespacellarp_1_1config.md#variable-required)** <br>Value to pass for an [OptionDefinition](Classes/structllarp_1_1OptionDefinition.md) to indicate that the option is required.  |
| constexpr [Hidden_t](Classes/structllarp_1_1config_1_1Hidden__t.md) | **[Hidden](Namespaces/namespacellarp_1_1config.md#variable-hidden)** <br>Value to pass for an [OptionDefinition](Classes/structllarp_1_1OptionDefinition.md) to indicate that the option should be hidden from the generate config file if it is unset (and has no comment).  |
| constexpr [MultiValue_t](Classes/structllarp_1_1config_1_1MultiValue__t.md) | **[MultiValue](Namespaces/namespacellarp_1_1config.md#variable-multivalue)** <br>Value to pass for an [OptionDefinition](Classes/structllarp_1_1OptionDefinition.md) to indicate that the option takes multiple values.  |
| constexpr [RelayOnly_t](Classes/structllarp_1_1config_1_1RelayOnly__t.md) | **[RelayOnly](Namespaces/namespacellarp_1_1config.md#variable-relayonly)** <br>Value to pass for an option that should only be set for relay configs.  |
| constexpr [ClientOnly_t](Classes/structllarp_1_1config_1_1ClientOnly__t.md) | **[ClientOnly](Namespaces/namespacellarp_1_1config.md#variable-clientonly)** <br>Value to pass for an option that should only be set for client configs.  |
| constexpr [Deprecated_t](Classes/structllarp_1_1config_1_1Deprecated__t.md) | **[Deprecated](Namespaces/namespacellarp_1_1config.md#variable-deprecated)** <br>Value to pass for an option that is deprecated and does nothing and should be ignored (with a deprecation warning) if specified.  |
| constexpr bool | **[is_default](Namespaces/namespacellarp_1_1config.md#variable-is-default)**  |
| constexpr bool | **[is_default< Default< T > >](Namespaces/namespacellarp_1_1config.md#variable-is-default<-default<-t->->)**  |
| constexpr bool | **[is_default< U & >](Namespaces/namespacellarp_1_1config.md#variable-is-default<-u-&->)**  |
| constexpr bool | **[is_default_array](Namespaces/namespacellarp_1_1config.md#variable-is-default-array)**  |
| constexpr bool | **[is_default_array< U & >](Namespaces/namespacellarp_1_1config.md#variable-is-default-array<-u-&->)**  |
| constexpr bool | **[is_option](Namespaces/namespacellarp_1_1config.md#variable-is-option)**  |

## Types Documentation

### using remove_cvref_t

```cpp
template <typename T >
using llarp::config::remove_cvref_t = typedef std::remove_cv_t<std::remove_reference_t<T> >;
```



## Functions Documentation

### function AssignmentAcceptor

```cpp
template <typename T >
auto AssignmentAcceptor(
    T & ref
)
```

A convenience function that returns an acceptor which assigns to a reference. 

Note that this holds on to the reference; it must only be used when this is safe to do. In particular, a reference to a local variable may be problematic. 



## Attributes Documentation

### variable Required

```cpp
constexpr Required_t Required {};
```

Value to pass for an [OptionDefinition](Classes/structllarp_1_1OptionDefinition.md) to indicate that the option is required. 

### variable Hidden

```cpp
constexpr Hidden_t Hidden {};
```

Value to pass for an [OptionDefinition](Classes/structllarp_1_1OptionDefinition.md) to indicate that the option should be hidden from the generate config file if it is unset (and has no comment). 

Typically for deprecated, renamed options that still do something, and for internal dev options that aren't usefully exposed. (For do-nothing deprecated options use Deprecated instead). 


### variable MultiValue

```cpp
constexpr MultiValue_t MultiValue {};
```

Value to pass for an [OptionDefinition](Classes/structllarp_1_1OptionDefinition.md) to indicate that the option takes multiple values. 

### variable RelayOnly

```cpp
constexpr RelayOnly_t RelayOnly {};
```

Value to pass for an option that should only be set for relay configs. 

If found in a client config it be ignored (but will produce a warning). 


### variable ClientOnly

```cpp
constexpr ClientOnly_t ClientOnly {};
```

Value to pass for an option that should only be set for client configs. 

If found in a relay config it will be ignored (but will produce a warning). 


### variable Deprecated

```cpp
constexpr Deprecated_t Deprecated {};
```

Value to pass for an option that is deprecated and does nothing and should be ignored (with a deprecation warning) if specified. 

Note that Deprecated implies Hidden, and that {client,relay}-only options in a {relay,client} config are also considered Deprecated. 


### variable is_default

```cpp
constexpr bool is_default = false;
```


### variable is_default< Default< T > >

```cpp
constexpr bool is_default< Default< T > > = true;
```


### variable is_default< U & >

```cpp
constexpr bool is_default< U & > = is_default<remove_cvref_t<U>>;
```


### variable is_default_array

```cpp
constexpr bool is_default_array = false;
```


### variable is_default_array< U & >

```cpp
constexpr bool is_default_array< U & > = is_default_array<remove_cvref_t<U>>;
```


### variable is_option

```cpp
constexpr bool is_option =
        std::is_base_of_v<
            option_flag,
            remove_cvref_t<
                Option>> or std::is_same_v<Comment, Option> or is_default<Option> or is_default_array<Option> or std::is_invocable_v<remove_cvref_t<Option>, T>;
```





-------------------------------

Updated on 2023-01-24 at 18:23:42 +0000