summaryrefslogtreecommitdiffstats
path: root/ml/dlib/dlib/sequence/sequence_sort_abstract.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-09 13:19:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-09 13:20:02 +0000
commit58daab21cd043e1dc37024a7f99b396788372918 (patch)
tree96771e43bb69f7c1c2b0b4f7374cb74d7866d0cb /ml/dlib/dlib/sequence/sequence_sort_abstract.h
parentReleasing debian version 1.43.2-1. (diff)
downloadnetdata-58daab21cd043e1dc37024a7f99b396788372918.tar.xz
netdata-58daab21cd043e1dc37024a7f99b396788372918.zip
Merging upstream version 1.44.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ml/dlib/dlib/sequence/sequence_sort_abstract.h')
-rw-r--r--ml/dlib/dlib/sequence/sequence_sort_abstract.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/ml/dlib/dlib/sequence/sequence_sort_abstract.h b/ml/dlib/dlib/sequence/sequence_sort_abstract.h
new file mode 100644
index 000000000..fe0a91220
--- /dev/null
+++ b/ml/dlib/dlib/sequence/sequence_sort_abstract.h
@@ -0,0 +1,65 @@
+// Copyright (C) 2003 Davis E. King (davis@dlib.net)
+// License: Boost Software License See LICENSE.txt for the full license.
+#undef DLIB_SEQUENCE_SORt_ABSTRACT_
+#ifdef DLIB_SEQUENCE_SORt_ABSTRACT_
+
+#include "sequence_kernel_abstract.h"
+
+namespace dlib
+{
+
+ template <
+ typename seq_base
+ >
+ class sequence_sort : public seq_base
+ {
+
+ /*!
+ REQUIREMENTS ON T
+ T must implement operator< for its type
+
+ REQUIREMENTS ON seq_base
+ must be an implementation of sequence/sequence_kernel_abstract.h
+
+
+
+ POINTERS AND REFERENCES TO INTERNAL DATA
+ sort() may invalidate pointers and references to data members.
+
+ WHAT THIS EXTENSION DOES FOR sequence
+ this gives a sequence the ability to sort its contents by calling sort()
+ !*/
+
+
+ public:
+
+ void sort (
+ );
+ /*!
+ ensures
+ - for all elements in #*this the ith element is <= the i+1 element
+ - #at_start() == true
+ throws
+ - std::bad_alloc or any exception thrown by T's constructor
+ data may be lost if sort() throws
+ !*/
+
+
+ };
+
+
+ template <
+ typename seq_base
+ >
+ inline void swap (
+ sequence_sort<seq_base>& a,
+ sequence_sort<seq_base>& b
+ ) { a.swap(b); }
+ /*!
+ provides a global swap function
+ !*/
+
+}
+
+#endif // DLIB_SEQUENCE_SORt_ABSTRACT_
+