Programming I version 1.5.3
Programming I C Library
Loading...
Searching...
No Matches
Data Fields
IntOption Struct Reference

An integer option represents either an integer or nothing. More...

#include <basedefs.h>

Data Fields

bool none
 
int some
 

Detailed Description

An integer option represents either an integer or nothing.

Option types are typically used with functions that may return a value of the given type or nothing (i.e. the return value is optional). The none member is true if the value is not present. Otherwise the value can be accessed with the some member.

Example:

IntOption op = index_of_int_value(array, 123); // index of value 123?
if (op.none) {
printsln("value not found");
} else {
}
void printiln(int i)
Prints an integer followed by a line break.
void printsln(String s)
Prints a String followed by a line break.
An integer option represents either an integer or nothing.
Definition basedefs.h:149
int some
Definition basedefs.h:151
bool none
Definition basedefs.h:150
See also
make_int_none
make_int_some

Field Documentation

◆ none

bool IntOption::none

◆ some

int IntOption::some

The documentation for this struct was generated from the following file: