acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
transfer.h
1//
2// transfer.h
3// acme
4//
5// Created by Camilo Sasuke Thomas Borregaard Soerensen on 31/05/22.
6// Copyright (c) 2022 Camilo Sasuke Thomas Borregaard Soerensen. All rights reserved.
7//
8#pragma once
9
10
11template < typename TYPE >
12inline
13non_reference < TYPE > && transfer(TYPE && t)
14{
15
16 return static_cast< non_reference< TYPE > && >(t);
17
18}
19
20
21template < typename TYPE >
22inline
23const non_reference < TYPE > &&transfer(const TYPE && t)
24{
25
26 return static_cast < const non_const < non_reference < TYPE > > && >(t);
27
28}
29
30template < typename TYPE >
31inline
32const non_reference < TYPE > * && transfer(TYPE * const & t)
33{
34
35 return (const non_reference < non_const < TYPE > > * &&)((const non_const < TYPE > * &) t);
36
37}
38
39
40
41