Skip to content

Commit

Permalink
using xtd::collections::generic::lesser class
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Feb 3, 2025
1 parent 9bb3f66 commit c528f37
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// @copyright Copyright (c) 2025 Gammasoft. All rights reserved.
#pragma once
#include "helpers/allocator.hpp"
#include "helpers/comparer.hpp"
#include "helpers/lesser.hpp"
#include "dictionary.hpp" /// @todo remove when sorted_dictionay is developped.
#include <map>

Expand All @@ -16,7 +16,7 @@ namespace xtd {
/// @brief Represents a collection of key/value pairs that are sorted on the key.
/// @par Definition
/// ```cpp
/// template<class key_t, class value_t, class comparer_t = helpers::comparer<key_t>, class allocator_t = helpers::allocator<std::pair<const key_t, value_t>>>
/// template<class key_t, class value_t, class lesser_t = helpers::lesser<key_t>, class allocator_t = helpers::allocator<std::pair<const key_t, value_t>>>
/// class sorted_dictionary : public xtd::object, public xtd::collections::generic::idictionary<key_t, value_t>;
/// ```
/// @par Header
Expand All @@ -33,9 +33,9 @@ namespace xtd {
/// @par Examples
/// The following shows how to use xtd::collections::generic::sorted_dictionary.
/// @include sorted_dictionary.cpp
template<class key_t, class value_t, class comparer_t = helpers::comparer<key_t>, class allocator_t = helpers::allocator<std::pair<const key_t, value_t>>>
template<class key_t, class value_t, class lesser_t = helpers::lesser<key_t>, class allocator_t = helpers::allocator<std::pair<const key_t, value_t>>>
using sorted_dictionary = dictionary<key_t, value_t, helpers::hasher<key_t>, helpers::equator<key_t>, allocator_t>;
//using sorted_dictionary = std::map<key_t, value_t, comparer_t, allocator_t>;
//using sorted_dictionary = std::map<key_t, value_t, lesser_t, allocator_t>;
}
}
}
4 changes: 2 additions & 2 deletions src/xtd.core/include/xtd/collections/generic/sorted_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// @copyright Copyright (c) 2025 Gammasoft. All rights reserved.
#pragma once
#include "helpers/allocator.hpp"
#include "helpers/comparer.hpp"
#include "helpers/lesser.hpp"
#include "sorted_dictionary.hpp" /// @todo remove when sorted_dictionay is developped.

/// @brief The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Expand Down Expand Up @@ -33,7 +33,7 @@ namespace xtd {
/// The following shows how to use xtd::collections::generic::sorted_list.
/// @include sorted_list.cpp
template<class key_t, class value_t, class allocator_t = helpers::allocator<std::pair<const key_t, value_t>>>
using sorted_list = sorted_dictionary<key_t, value_t, helpers::comparer<key_t>, allocator_t>;
using sorted_list = sorted_dictionary<key_t, value_t, helpers::lesser<key_t>, allocator_t>;
}
}
}
8 changes: 4 additions & 4 deletions src/xtd.core/include/xtd/collections/generic/sorted_set.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// @copyright Copyright (c) 2025 Gammasoft. All rights reserved.
#pragma once
#include "helpers/allocator.hpp"
#include "helpers/comparer.hpp"
#include "helpers/lesser.hpp"
#include "iset.hpp"
#include <set>

Expand All @@ -16,7 +16,7 @@ namespace xtd {
/// @brief Represents a collection of objects that is maintained in sorted order.
/// @par Definition
/// ```cpp
/// template<class type_t, class comparer_t = xtd::collections::generic::helpers::comparer<type_t>, class allocator_t = xtd::collections::generic::helpers::allocator<type_t>>
/// template<class type_t, class lesser_t = xtd::collections::generic::helpers::lesser<type_t>, class allocator_t = xtd::collections::generic::helpers::allocator<type_t>>
/// using sorted_set = std::set<type_t, comparer_t, allocator_t>;
/// ```
/// @par Header
Expand All @@ -33,8 +33,8 @@ namespace xtd {
/// @par Examples
/// The following example demonstrates how to merge two disparate sets. This example creates two xtd::collections::generic::sorted_set objects, and populates them with even and odd numbers, respectively. A third xtd::collections::generic::sorted_set object is created from the set that contains the even numbers. The example then calls the UnionWith method, which adds the odd number set to the third set.
/// @include sorted_set.cpp
template<class type_t, class comparer_t = xtd::collections::generic::helpers::comparer<type_t>, class allocator_t = xtd::collections::generic::helpers::allocator<type_t>>
using sorted_set = std::set<type_t, comparer_t, allocator_t>;
template<class type_t, class lesser_t = xtd::collections::generic::helpers::lesser<type_t>, class allocator_t = xtd::collections::generic::helpers::allocator<type_t>>
using sorted_set = std::set<type_t, lesser_t, allocator_t>;
}
}
}

0 comments on commit c528f37

Please sign in to comment.