liblloyal 1.0.0
Branched Inference for llama.cpp
Loading...
Searching...
No Matches
lloyal::detail Namespace Reference

Classes

struct  is_optional
 Type trait to detect std::optional<T> More...
 
struct  is_optional< std::optional< T > >
 

Functions

template<class X , class T >
constexpr T as_value (const X &x, T def)
 Extract value from either T or std::optional<T> with fallback.
 

Function Documentation

◆ as_value()

template<class X , class T >
constexpr T lloyal::detail::as_value ( const X &  x,
def 
)
constexpr

Extract value from either T or std::optional<T> with fallback.

Handles both:

  • Direct values (T): cast to target type
  • Optional values (std::optional<T>): unwrap with value_or(default)

Used by sampler to accept Nitrogen-generated params (which use std::optional)

Examples
/home/runner/work/liblloyal/liblloyal/include/lloyal/branch.hpp.

Definition at line 50 of file sampler.hpp.