summaryrefslogtreecommitdiff
path: root/libcutl/cutl/container/key.hxx
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2024-03-06 10:24:11 +0100
committerJörg Frings-Fürst <debian@jff.email>2024-03-06 10:24:11 +0100
commit4538829ab86b5a1cd4e845e7eab165029c9d6d46 (patch)
treebbadf39aed0610c8f8f7b41fefff47773b8ac205 /libcutl/cutl/container/key.hxx
parent23d41842168ac1a1580111b9c5c73500ceee3d57 (diff)
parentaad5ad9bf0c02aa4e79bc6b7d6c934612fff4026 (diff)
Update upstream source from tag 'upstream/4.2.0'
Update to upstream version '4.2.0' with Debian dir 1b38df7bbcf313223de3c50107ac0255090fe647
Diffstat (limited to 'libcutl/cutl/container/key.hxx')
-rw-r--r--libcutl/cutl/container/key.hxx71
1 files changed, 0 insertions, 71 deletions
diff --git a/libcutl/cutl/container/key.hxx b/libcutl/cutl/container/key.hxx
deleted file mode 100644
index 42f0fe5..0000000
--- a/libcutl/cutl/container/key.hxx
+++ /dev/null
@@ -1,71 +0,0 @@
-// file : cutl/container/key.hxx
-// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
-// license : MIT; see accompkeying LICENSE file
-
-#ifndef CUTL_CONTAINER_KEY_HXX
-#define CUTL_CONTAINER_KEY_HXX
-
-namespace cutl
-{
- namespace container
- {
- // A modifiable map key wrapper that can be used to implement multi-
- // index containers, as discussed in the following post:
- //
- // http://www.codesynthesis.com/~boris/blog/2012/09/11/emulating-boost-multi-index-with-std-containers/
- //
- template <class T1, class T2 = void, class T3 = void>
- struct key;
-
- template <class T1>
- struct key<T1, void, void>
- {
- mutable const T1* p1;
-
- key (): p1 (0) {}
- key (const T1& r1): p1 (&r1) {}
- void assign (const T1& r1) const {p1 = &r1;}
-
- bool operator< (const key& x) const {return *p1 < *x.p1;}
- };
-
- template <class T1, class T2>
- struct key<T1, T2, void>
- {
- mutable const T1* p1;
- mutable const T2* p2;
-
- key (): p1 (0), p2 (0) {}
- key (const T1& r1, const T2& r2): p1 (&r1), p2 (&r2) {}
- void assign (const T1& r1, const T2& r2) const {p1 = &r1; p2 = &r2;}
-
- bool operator< (const key& x) const
- {
- return *p1 < *x.p1 || (!(*x.p1 < *p1) && *p2 < *x.p2);
- }
- };
-
- template <class T1, class T2, class T3>
- struct key
- {
- mutable const T1* p1;
- mutable const T2* p2;
- mutable const T3* p3;
-
- key (): p1 (0), p2 (0), p3 (0) {}
- key (const T1& r1, const T2& r2, const T3& r3)
- : p1 (&r1), p2 (&r2) , p3 (&r3) {}
- void assign (const T1& r1, const T2& r2, const T3& r3) const
- {p1 = &r1; p2 = &r2; p3 = &r3;}
-
- bool operator< (const key& x) const
- {
- return (*p1 < *x.p1 ||
- (!(*x.p1 < *p1) && (*p2 < *x.p2 ||
- (!(*x.p2 < *p2) && *p3 < *x.p3))));
- }
- };
- }
-}
-
-#endif // CUTL_CONTAINER_KEY_HXX