summaryrefslogtreecommitdiffhomepage
path: root/include/stc/carc.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-05-19 11:22:03 +0200
committerTyge Løvset <[email protected]>2022-05-19 11:22:03 +0200
commitbb8484be936d82f0f01b99ca67a6de1508037e8f (patch)
tree07167891bf7c153380894e33377dd48816dfba99 /include/stc/carc.h
parent775d0b3fce76be7512671c711d4aa16a5fa34a40 (diff)
downloadSTC-modified-bb8484be936d82f0f01b99ca67a6de1508037e8f.tar.gz
STC-modified-bb8484be936d82f0f01b99ca67a6de1508037e8f.zip
Added _toval() in carc and cbox. Added dynamic polymorphism example, shape.c.
Diffstat (limited to 'include/stc/carc.h')
-rw-r--r--include/stc/carc.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/stc/carc.h b/include/stc/carc.h
index 6c591d2c..e4a69e80 100644
--- a/include/stc/carc.h
+++ b/include/stc/carc.h
@@ -115,6 +115,9 @@ STC_INLINE _cx_self _cx_memb(_make)(_cx_value val) {
STC_INLINE _cx_raw _cx_memb(_toraw)(const _cx_self* self)
{ return i_keyto(self->get); }
+STC_INLINE _cx_value _cx_memb(_toval)(const _cx_self* self)
+ { return *self->get; }
+
STC_INLINE _cx_self _cx_memb(_move)(_cx_self* self) {
_cx_self ptr = *self;
self->get = NULL, self->use_count = NULL;