mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-25 18:46:32 +03:00
Use std::get_if
This commit is contained in:
parent
88183eb484
commit
c457766a1f
1 changed files with 2 additions and 2 deletions
|
@ -340,8 +340,8 @@ void printMultiLineString(Out & out, const Value & v)
|
||||||
void printValue(Context * ctx, Out & out, std::variant<Value, std::exception_ptr> maybe_value, const std::string & path)
|
void printValue(Context * ctx, Out & out, std::variant<Value, std::exception_ptr> maybe_value, const std::string & path)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (std::holds_alternative<std::exception_ptr>(maybe_value)) {
|
if (auto ex = std::get_if<std::exception_ptr>(&maybe_value)) {
|
||||||
std::rethrow_exception(std::get<std::exception_ptr>(maybe_value));
|
std::rethrow_exception(*ex);
|
||||||
}
|
}
|
||||||
Value v = evaluateValue(ctx, &std::get<Value>(maybe_value));
|
Value v = evaluateValue(ctx, &std::get<Value>(maybe_value));
|
||||||
if (ctx->state->isDerivation(v)) {
|
if (ctx->state->isDerivation(v)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue