Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

C++ Language/Type/Variant/AnyVariant

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

A variable xVar whose type is std::any can store values of differing types at different points in time. After assigning xVar = 1.1F;, that float value can be accessed by std::any_cast<float>(xVar);. An uninitialized any-variable will be in a special "no value" state that will be reported by xVar.has_value(). Additional information about any-variant (includes interactive examples)