xo-gc: + GCObjectConversion template
This commit is contained in:
parent
6972363118
commit
0a1aa8c0f1
1 changed files with 30 additions and 0 deletions
30
xo-gc/include/xo/gc/GCObjectConversion.hpp
Normal file
30
xo-gc/include/xo/gc/GCObjectConversion.hpp
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
/** @file GCObjectConversion.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Jan 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xo/gc/GCObject.hpp>
|
||||
#include <xo/alloc2/Allocator.hpp>
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @brief compile-time conversion obj<AGCObject> <-> T
|
||||
*
|
||||
* Specialize for each T that participates in conversion.
|
||||
* Methods here aren't implemented
|
||||
**/
|
||||
template <typename T>
|
||||
struct GCObjectConversion {
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
|
||||
static obj<AGCObject> to_gco(obj<AAllocator> mm, const T & x);
|
||||
static T from_gco(obj<AAllocator> mm, obj<AGCObject> gco);
|
||||
};
|
||||
|
||||
} /*namespace scm */
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end GCObjectConversion.hpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue