Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
solpp 4.0
solpp 4.0
  • tutorial
    • tutorial: quick ‘n’ dirty
    • getting started
    • integrating into existing code
    • variables
    • functions and You
    • C++ in Lua
    • ownership
    • adding your own types
  • errors
  • supported compilers, binary size, compile time
  • features
  • functions
  • usertypes
  • containers
  • threading
  • customization traits
  • api reference manual
    • state
    • this_state
    • lua_value
    • reference
    • stack_reference
    • make_object/make_reference
    • table
    • table traversal keys
    • userdata
    • environment
    • this_environment
    • proxy, (protectedunsafe)_function_result - proxy_base derivatives
    • as_container
    • nested
    • as_table
    • usertype<T>
    • usertype memory
    • unique_usertype_traits<T>
    • tie
    • function
    • protected_function
    • coroutine
    • yielding
    • error
    • object
    • thread
    • optional<T>
    • variadic_args
    • variadic_results
    • as_args
    • as_returns
    • overload
    • property
    • var
    • protect
    • policies
    • readonly
    • as_function
    • c_call
    • resolve
    • stack namespace
    • light<T>/user<T>
    • compatibility.hpp
    • types
    • metatable_key
    • new_table
  • mentions
  • benchmarks
  • getting performance
  • config and safety
  • exceptions
  • run-time type information (rtti)
  • unicode transformation format handling
  • build
  • licenses
  • origin
Back to top
View this page
Edit this page

optional<T>¶

This is an implemention of optional from the standard library. If it detects that a proper optional exists, it will attempt to use it. This is mostly an implementation detail, used in the sol::stack::check_get and sol::stack::get<optional<T>> and sol::optional<T> maybe_value = table["arf"]; implementations for additional safety reasons.

See this example here for a demonstration on how to use it and other features!

Next
variadic_args
Previous
thread
Copyright © 2022, ThePhD
Made with Sphinx and @pradyunsg's Furo