2
0
mirror of https://github.com/boostorg/scope.git synced 2026-01-26 19:12:08 +00:00

Merge pull request #4 from grisumbras/vcpkg-port

Vcpkg port
This commit is contained in:
Andrey Semashev
2023-11-05 19:58:51 +03:00
committed by GitHub
4 changed files with 161 additions and 0 deletions

View File

@@ -34,6 +34,16 @@ example, using a `conanfile.txt`:
boost_scope/1.0.0
````
#### Using vcpkg
````
git clone https://github.com/Lastique/scope
vcpkg install boost-scope --overlay-ports=scope/vcpkg/ports/boost-scope
````
This will install Scope and all the required Boost packages if they were not
already installed.
### More information
* Read the [documentation](https://lastique.github.io/scope/libs/scope/doc/html/index.html).

View File

@@ -0,0 +1,103 @@
diff --git a/include/boost/scope/unique_resource.hpp b/include/boost/scope/unique_resource.hpp
index 08f4fc6..c97e3b1 100644
--- a/include/boost/scope/unique_resource.hpp
+++ b/include/boost/scope/unique_resource.hpp
@@ -16,7 +16,7 @@
#include <type_traits>
#include <boost/core/addressof.hpp>
-#include <boost/core/invoke_swap.hpp>
+#include <boost/core/swap.hpp>
#include <boost/scope/unique_resource_fwd.hpp>
#include <boost/scope/detail/config.hpp>
#include <boost/scope/detail/compact_storage.hpp>
@@ -615,8 +615,8 @@ private:
void swap_impl(unique_resource_data& that, std::true_type, std::true_type) noexcept
{
- boost::core::invoke_swap(get_internal_resource(), that.get_internal_resource());
- boost::core::invoke_swap(get_internal_deleter(), that.get_internal_deleter());
+ boost::swap(get_internal_resource(), that.get_internal_resource());
+ boost::swap(get_internal_deleter(), that.get_internal_deleter());
const bool allocated = m_allocated;
m_allocated = that.m_allocated;
@@ -625,14 +625,14 @@ private:
void swap_impl(unique_resource_data& that, std::true_type, std::false_type)
{
- boost::core::invoke_swap(get_internal_resource(), that.get_internal_resource());
+ boost::swap(get_internal_resource(), that.get_internal_resource());
try
{
- boost::core::invoke_swap(get_internal_deleter(), that.get_internal_deleter());
+ boost::swap(get_internal_deleter(), that.get_internal_deleter());
}
catch (...)
{
- boost::core::invoke_swap(get_internal_resource(), that.get_internal_resource());
+ boost::swap(get_internal_resource(), that.get_internal_resource());
throw;
}
@@ -643,14 +643,14 @@ private:
void swap_impl(unique_resource_data& that, std::false_type, std::false_type)
{
- boost::core::invoke_swap(get_internal_deleter(), that.get_internal_deleter());
+ boost::swap(get_internal_deleter(), that.get_internal_deleter());
try
{
- boost::core::invoke_swap(get_internal_resource(), that.get_internal_resource());
+ boost::swap(get_internal_resource(), that.get_internal_resource());
}
catch (...)
{
- boost::core::invoke_swap(get_internal_deleter(), that.get_internal_deleter());
+ boost::swap(get_internal_deleter(), that.get_internal_deleter());
throw;
}
@@ -896,34 +896,34 @@ private:
void swap_impl(unique_resource_data& that, std::true_type, std::true_type) noexcept
{
- boost::core::invoke_swap(get_internal_resource(), that.get_internal_resource());
- boost::core::invoke_swap(get_internal_deleter(), that.get_internal_deleter());
+ boost::swap(get_internal_resource(), that.get_internal_resource());
+ boost::swap(get_internal_deleter(), that.get_internal_deleter());
}
void swap_impl(unique_resource_data& that, std::true_type, std::false_type)
{
- boost::core::invoke_swap(get_internal_resource(), that.get_internal_resource());
+ boost::swap(get_internal_resource(), that.get_internal_resource());
try
{
- boost::core::invoke_swap(get_internal_deleter(), that.get_internal_deleter());
+ boost::swap(get_internal_deleter(), that.get_internal_deleter());
}
catch (...)
{
- boost::core::invoke_swap(get_internal_resource(), that.get_internal_resource());
+ boost::swap(get_internal_resource(), that.get_internal_resource());
throw;
}
}
void swap_impl(unique_resource_data& that, std::false_type, std::false_type)
{
- boost::core::invoke_swap(get_internal_deleter(), that.get_internal_deleter());
+ boost::swap(get_internal_deleter(), that.get_internal_deleter());
try
{
- boost::core::invoke_swap(get_internal_resource(), that.get_internal_resource());
+ boost::swap(get_internal_resource(), that.get_internal_resource());
}
catch (...)
{
- boost::core::invoke_swap(get_internal_deleter(), that.get_internal_deleter());
+ boost::swap(get_internal_deleter(), that.get_internal_deleter());
throw;
}
}

View File

@@ -0,0 +1,23 @@
# Copyright 2023 Dmitry Arkhipov (grisumbras@yandex.ru)
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# https://www.boost.org/LICENSE_1_0.txt)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Lastique/scope
REF 6c14f5ccbdc0cb8dfad082f6f3bd5f0d3cdb8cf1
SHA512 a4f647cb134a91e24a8f159646bb0912866a03047386579184298f6e5dad0b8c2a6df452390bb21954b313c80ddf2cd1d91ec5cdeb8ec4789a1f3f137f21ed5e
HEAD_REF develop
PATCHES 1.83_compat.patch
)
file(
INSTALL "${SOURCE_PATH}/LICENSE"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}"
RENAME copyright)
file(
INSTALL "${SOURCE_PATH}/include/"
DESTINATION "${CURRENT_PACKAGES_DIR}/include"
PATTERN "${SOURCE_PATH}/include/*")

View File

@@ -0,0 +1,25 @@
{
"name": "boost-scope",
"version": "1.84.0",
"description": "Scope guards from Fundamentals TS 3",
"homepage": "https://github.com/Lastique/scope",
"dependencies": [
{
"name": "boost-build",
"host": true,
"version>=": "1.83.0"
},
{
"name": "boost-config",
"version>=": "1.83.0"
},
{
"name": "boost-core",
"version>=": "1.83.0"
},
{
"name": "boost-type-traits",
"version>=": "1.83.0"
}
]
}