mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-14 11:40:35 +07:00
remove unnecessary code
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
#include "meta_base/hashed_string.hpp"
|
||||
#include "meta_base/insert_or_assign.hpp"
|
||||
#include "meta_base/intrusive_ptr.hpp"
|
||||
#include "meta_base/is_disjoint.hpp"
|
||||
#include "meta_base/is_in_place_type.hpp"
|
||||
#include "meta_base/memory_buffer.hpp"
|
||||
#include "meta_base/noncopyable.hpp"
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <compare>
|
||||
#include <concepts>
|
||||
#include <deque>
|
||||
#include <exception>
|
||||
#include <functional>
|
||||
@@ -25,7 +24,6 @@
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <set>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
@@ -38,27 +38,6 @@ namespace meta_hpp::detail
|
||||
}
|
||||
}
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
template < typename Key, typename Compare, typename Allocator >
|
||||
void insert_or_assign( //
|
||||
std::set<Key, Compare, Allocator>& set,
|
||||
std::set<Key, Compare, Allocator>& value
|
||||
) {
|
||||
set.swap(value);
|
||||
set.merge(value);
|
||||
}
|
||||
|
||||
template < typename Key, typename Compare, typename Allocator >
|
||||
void insert_or_assign( //
|
||||
std::set<Key, Compare, Allocator>& set,
|
||||
std::set<Key, Compare, Allocator>&& value
|
||||
) {
|
||||
set.swap(value);
|
||||
set.merge(std::move(value));
|
||||
}
|
||||
}
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
template < typename Key, typename Value, typename Compare, typename Allocator >
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* This file is part of the "https://github.com/blackmatov/meta.hpp"
|
||||
* For conditions of distribution and use, see copyright notice in LICENSE.md
|
||||
* Copyright (C) 2021-2023, by Matvey Cherevko (blackmatov@gmail.com)
|
||||
******************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "base.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
template < typename SortedContainerL, typename SortedContainerR, typename Compare >
|
||||
bool is_disjoint(const SortedContainerL& l, const SortedContainerR& r, Compare compare) {
|
||||
using std::begin;
|
||||
using std::end;
|
||||
|
||||
for ( auto iter_l{begin(l)}, iter_r{begin(r)}; iter_l != end(l) && iter_r != end(r); ) {
|
||||
if ( compare(*iter_l, *iter_r) ) {
|
||||
++iter_l;
|
||||
} else if ( compare(*iter_r, *iter_l) ) {
|
||||
++iter_r;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
template < typename SortedContainerL, typename SortedContainerR >
|
||||
bool is_disjoint(const SortedContainerL& l, const SortedContainerR& r) {
|
||||
return is_disjoint(l, r, std::less<>{});
|
||||
}
|
||||
}
|
||||
@@ -164,13 +164,13 @@ namespace meta_hpp::detail
|
||||
static auto data{std::make_unique<TypeData>(std::forward<Args>(args)...)};
|
||||
|
||||
const locker lock;
|
||||
types_.emplace(any_type{data.get()});
|
||||
types_.emplace_back(data.get());
|
||||
|
||||
return data.get();
|
||||
}
|
||||
|
||||
private:
|
||||
std::recursive_mutex mutex_;
|
||||
std::set<any_type, std::less<>> types_;
|
||||
std::vector<any_type> types_;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user