Skip to content

Commit

Permalink
util: disable unique_resource
Browse files Browse the repository at this point in the history
We are not using it anywhere and it is causing compilation
warnings (errors in debug builds) with clang 19 and later.

Change-Id: I5f48b3bae28adc9ba3bb115513b5f6eed1529acf
  • Loading branch information
Pesa committed Dec 7, 2024
1 parent 0751bba commit 0311642
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 7 additions & 5 deletions ndn-cxx/detail/nonstd/scope-lite.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,8 @@ make_scope_success( EF && exit_function )

// unique_resource:

#if 0 // https://github.com/martinmoene/scope-lite/issues/15

template< class R, class D >
class unique_resource
{
Expand Down Expand Up @@ -1130,8 +1132,8 @@ class unique_resource
}

scope_is_delete_access:
unique_resource & operator=( unique_resource const & ) scope_is_delete;
unique_resource( unique_resource const & ) scope_is_delete;
unique_resource & operator=( unique_resource const & ) scope_is_delete;
unique_resource( unique_resource const & ) scope_is_delete;

private:
R1 resource;
Expand Down Expand Up @@ -1206,6 +1208,8 @@ scope_noexcept_op

#endif // scope_HAVE_DEFAULT_FUNCTION_TEMPLATE_ARG

#endif // https://github.com/martinmoene/scope-lite/issues/15

#else // #if scope_USE_POST_CPP98_VERSION

//
Expand Down Expand Up @@ -1396,7 +1400,7 @@ class unique_resource
try
{
reset();
resource = r;
resource = r;
execute_on_reset = true;
}
catch(...)
Expand Down Expand Up @@ -1481,12 +1485,10 @@ namespace nonstd
using scope::scope_exit;
using scope::scope_fail;
using scope::scope_success;
using scope::unique_resource;

using scope::make_scope_exit;
using scope::make_scope_fail;
using scope::make_scope_success;
using scope::make_unique_resource_checked;
}

#endif // scope_USES_STD_SCOPE
Expand Down
4 changes: 1 addition & 3 deletions ndn-cxx/util/scope.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2013-2021 Regents of the University of California.
* Copyright (c) 2013-2024 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
Expand Down Expand Up @@ -30,12 +30,10 @@ namespace ndn {
using ::nonstd::scope_exit;
using ::nonstd::scope_fail;
using ::nonstd::scope_success;
using ::nonstd::unique_resource;

using ::nonstd::make_scope_exit;
using ::nonstd::make_scope_fail;
using ::nonstd::make_scope_success;
using ::nonstd::make_unique_resource_checked;

} // namespace ndn

Expand Down

0 comments on commit 0311642

Please sign in to comment.