File tree 1 file changed +11
-7
lines changed
1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -21,11 +21,15 @@ Author: Daniel Poetzl
21
21
#include < forward_list>
22
22
#include < type_traits>
23
23
24
- // #define _SN_SHARE_KEYS
24
+ #ifndef _SN_SMALL_MAP
25
+ #define _SN_SMALL_MAP 1
26
+ #endif
25
27
26
- // #define _SN_SMALL_MAP
28
+ #ifndef _SN_SHARE_KEYS
29
+ #define _SN_SHARE_KEYS 0
30
+ #endif
27
31
28
- #ifdef _SN_SMALL_MAP
32
+ #if _SN_SMALL_MAP == 1
29
33
#include " small_map.h"
30
34
#else
31
35
#include < map>
@@ -77,7 +81,7 @@ _sn_type_par_decl class d_internalt : public d_baset
77
81
{
78
82
public:
79
83
typedef sharing_node_innert<_sn_type_args> innert;
80
- #ifdef _SN_SMALL_MAP
84
+ #if _SN_SMALL_MAP == 1
81
85
typedef small_mapt<innert> to_mapt;
82
86
#else
83
87
typedef std::map<std::size_t , innert> to_mapt;
@@ -412,7 +416,7 @@ small_shared_ptrt<dataT>
412
416
_sn_type_par_decl class d_leaft : public small_shared_pointeet <unsigned >
413
417
{
414
418
public:
415
- #ifdef _SN_SHARE_KEYS
419
+ #if _SN_SHARE_KEYS == 1
416
420
std::shared_ptr<keyT> k;
417
421
#else
418
422
keyT k;
@@ -437,7 +441,7 @@ _sn_type_par_def class sharing_node_leaft
437
441
auto &d = write ();
438
442
439
443
// Copy key
440
- #ifdef _SN_SHARE_KEYS
444
+ #if _SN_SHARE_KEYS == 1
441
445
_sn_assert (d.k == nullptr );
442
446
d.k = std::make_shared<keyT>(k);
443
447
#else
@@ -452,7 +456,7 @@ _sn_type_par_def class sharing_node_leaft
452
456
{
453
457
_sn_assert (!empty ());
454
458
455
- #ifdef _SN_SHARE_KEYS
459
+ #if _SN_SHARE_KEYS == 1
456
460
return *read ().k ;
457
461
#else
458
462
return read ().k ;
You can’t perform that action at this time.
0 commit comments