---
name: "mlpack_util_Option"
section: "3"
platform: "linux"
package: "mlpack-doc"
version: "1.0.10-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/mlpack_util_Option"
---

# mlpack\_util\_Option(3)

A static object whose constructor registers a parameter with the CLI class.

## NAME

mlpack::util::Option\< N \> -

A static object whose constructor registers a parameter with the **CLI** class.

## SYNOPSIS

### Public Member Functions

**Option** (bool ignoreTemplate, N defaultValue, const std::string &identifier, const std::string &description, const std::string &parent=std::string(''), bool required=false)\
 *Construct an* **Option** *object.*  **Option** (const std::string &identifier, const std::string &description, const std::string &parent=std::string(''))\
 *Constructs an* **Option** *object.*

## Detailed Description

### template\<typename N\>class mlpack::util::Option\< N \>

A static object whose constructor registers a parameter with the **CLI** class.

This should not be used outside of **CLI** itself, and you should use the **PARAM\_FLAG()**, **PARAM\_DOUBLE()**, **PARAM\_INT()**, **PARAM\_STRING()**, or other similar macros to declare these objects instead of declaring them directly.

**See also:**

core/io/cli.hpp, **mlpack::CLI**

Definition at line 42 of file option.hpp.

## Constructor & Destructor Documentation

### template\<typename N \> mlpack::util::Option\< N \>::Option (boolignoreTemplate, NdefaultValue, const std::string &identifier, const std::string &description, const std::string &parent = `std::string('')`, boolrequired = `false`)

Construct an **Option** object. When constructed, it will register itself with **CLI**.

**Parameters:**

*ignoreTemplate* Whether or not the template type matters for this option. Essentially differs options with no value (flags) from those that do, and thus require a type. \
 *defaultValue* Default value this parameter will be initialized to. \
 *identifier* The name of the option (no dashes in front; for --help, we would pass 'help'). \
 *description* A short string describing the option. \
 *parent* Full pathname of the parent module that 'owns' this option. The default is the root node (an empty string). \
 *required* Whether or not the option is required at runtime.

### template\<typename N \> mlpack::util::Option\< N \>::Option (const std::string &identifier, const std::string &description, const std::string &parent = `std::string('')`)

Constructs an **Option** object. When constructed, it will register a flag with **CLI**.

**Parameters:**

*identifier* The name of the option (no dashes in front); for --help we would pass 'help'. \
 *description* A short string describing the option. \
 *parent* Full pathname of the parent module that 'owns' this option. The default is the root node (an empty string).

## Author

Generated automatically by Doxygen for MLPACK from the source code.
