SiddiqSoft.RunOnEnd 1.0.0

There is a newer version of this package available.
See the version list below for details.
Install-Package SiddiqSoft.RunOnEnd -Version 1.0.0
dotnet add package SiddiqSoft.RunOnEnd --version 1.0.0
<PackageReference Include="SiddiqSoft.RunOnEnd" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SiddiqSoft.RunOnEnd --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SiddiqSoft.RunOnEnd, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install SiddiqSoft.RunOnEnd as a Cake Addin
#addin nuget:?package=SiddiqSoft.RunOnEnd&version=1.0.0

// Install SiddiqSoft.RunOnEnd as a Cake Tool
#tool nuget:?package=SiddiqSoft.RunOnEnd&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

RunOnEnd : Run a lambda in destructor

CodeQL Build Status

Usage

#include "gtest/gtest.h"
#include "siddiqsoft/RunOnEnd.hpp"


TEST(examples, Example1)
{
    bool passTest {false};

    try
    {
        // Use initializer list-style instantiation; we do not allow move/assignment construction.
        // Note that the `()` is not required when the lambda/function takes no argument.
        siddiqsoft::RunOnEnd roe {[&passTest] {
            // Runs when this scope ends
            passTest = true;
        }};
    }
    catch (...)
    {
        EXPECT_TRUE(false); // if we throw then the test fails.
    }

    // Iff the lambda runs, it should be true
    EXPECT_TRUE(passTest);
}

<small align="right">

© 2021 Siddiq Software LLC. All rights reserved.

</small>

Product Versions
native native
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on SiddiqSoft.RunOnEnd:

Package Downloads
SiddiqSoft.AzureCppUtils

Azure REST API Helpers for Modern C++. Featuring helper functions for date-time, encryption tokens for Azure REST API as a single header-only package and native Win32 libraries.

SiddiqSoft.CosmosClient

Azure Cosmos REST-API Client for Modern C++

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.1 421 11/20/2021
1.2.0 1,940 8/18/2021
1.1.1 127 7/30/2021
1.1.0 336 7/28/2021
1.0.3 137 7/28/2021
1.0.2 114 7/27/2021
1.0.1 194 7/27/2021
1.0.0 168 7/26/2021