SiddiqSoft.TimeThis 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package SiddiqSoft.TimeThis --version 1.0.1                
NuGet\Install-Package SiddiqSoft.TimeThis -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SiddiqSoft.TimeThis" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SiddiqSoft.TimeThis --version 1.0.1                
#r "nuget: SiddiqSoft.TimeThis, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SiddiqSoft.TimeThis as a Cake Addin
#addin nuget:?package=SiddiqSoft.TimeThis&version=1.0.1

// Install SiddiqSoft.TimeThis as a Cake Tool
#tool nuget:?package=SiddiqSoft.TimeThis&version=1.0.1                

TimeThis : Run a lambda in destructor

CodeQL Build Status alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Objective

  • A simpler "run on end" vs. the custom deletor available via std::unique_ptr<>. It is important to note that we do not provide an "owning" helper as this is better accomplished via the destructor code for std::unique_ptr<>. Avoid writing code that exists in std.
  • Use the nuget SiddiqSoft.TimeThis
  • Copy paste..whatever works.
#include "gtest/gtest.h"
#include "siddiqsoft/TimeThis.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::TimeThis 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 Compatible and additional computed target framework versions.
native native is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SiddiqSoft.TimeThis:

Package Downloads
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
2.1.2 73 11/14/2024
2.1.1 70 11/8/2024
2.0.2 75 11/5/2024
2.0.1 71 11/5/2024
2.0.0 73 11/5/2024
1.3.1 76 11/5/2024
1.3.0 92 10/30/2024
1.2.1 75 10/30/2024
1.1.5 710 11/20/2021
1.1.4 327 7/30/2021
1.1.3 308 7/28/2021
1.1.2 358 7/28/2021
1.1.1 350 7/28/2021
1.1.0 9,085 7/28/2021
1.0.1 8,557 7/28/2021