summaryrefslogtreecommitdiffhomepage
path: root/include/stc/template.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-04-27 10:00:37 +0200
committerTyge Løvset <[email protected]>2022-04-27 10:00:37 +0200
commite6738b3da5cbd7703cf3fbd905b3fdac19d0ae24 (patch)
tree1cdac3ad406299219dc82e8eb4b9ae327d190eff /include/stc/template.h
parentc584a509c1f5ad91ecf96673c28da307eaa2408f (diff)
downloadSTC-modified-e6738b3da5cbd7703cf3fbd905b3fdac19d0ae24.tar.gz
STC-modified-e6738b3da5cbd7703cf3fbd905b3fdac19d0ae24.zip
Internal string container clone optimization.
Diffstat (limited to 'include/stc/template.h')
-rw-r--r--include/stc/template.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/stc/template.h b/include/stc/template.h
index 659f6a72..a523d07c 100644
--- a/include/stc/template.h
+++ b/include/stc/template.h
@@ -99,12 +99,14 @@
#if defined i_key_str
#define i_key_bind cstr
#define i_keyraw crawstr
+ #define i_keyclone cstr_clone
#ifndef i_tag
#define i_tag str
#endif
#elif defined i_key_ssv
#define i_key_bind cstr
#define i_keyraw csview
+ #define i_keyclone cstr_clone
#define i_keyfrom cstr_from_sv
#define i_keyto cstr_sv
#define i_eq csview_eq
@@ -114,7 +116,6 @@
#elif defined i_key_arcbox
#define i_key_bind i_key_arcbox
#define i_keyraw c_paste(i_key_arcbox, _value)
- // smart pointers have special clone, so override:
#define i_keyclone c_paste(i_key_arcbox, _clone)
#define _i_no_emplace
#endif
@@ -148,10 +149,8 @@
#error "no i_key or i_val provided"
#elif defined i_keyraw && !defined i_keyfrom
#error "if i_keyraw is defined, i_keyfrom (and normally i_keyto) must be defined"
-#elif defined i_drop
- #error "i_drop not supported. Define i_keydrop/i_valdrop instead."
-#elif defined i_from
- #error "i_from not supported. Define i_keyfrom/i_valfrom instead."
+#elif defined i_from || defined i_drop
+ #error "i_from / i_drop are not supported. Define i_keyfrom/i_valfrom and-or i_keydrop/i_valdrop instead."
#endif
#ifndef i_tag
@@ -194,9 +193,11 @@
#ifdef i_val_str
#define i_val_bind cstr
#define i_valraw crawstr
+ #define i_valclone cstr_clone
#elif defined i_val_ssv
#define i_val cstr
#define i_valraw csview
+ #define i_valclone cstr_clone
#define i_valfrom cstr_from_sv
#define i_valto cstr_sv
#define i_valdrop cstr_drop