P4C
The P4 Compiler
Loading...
Searching...
No Matches
autoclone_ptr< T, D > Class Template Reference

#include <autoclone.h>

Inheritance diagram for autoclone_ptr< T, D >:
[legend]

Public Member Functions

 autoclone_ptr (autoclone_ptr &&)=default
 
 autoclone_ptr (const autoclone_ptr &a)
 
autoclone_ptroperator= (autoclone_ptr &&)=default
 
autoclone_ptroperator= (const autoclone_ptr &a)
 

Detailed Description

template<class T, class D = std::default_delete<T>>
class autoclone_ptr< T, D >

Copyright (C) 2024 Intel Corporation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SPDX-License-Identifier: Apache-2.0 Adaptor/wrapper class for std::unique_ptr that allows copying by cloning the pointed at object. An autoclone_ptr can be used when you want to make a pointer field act like a value field – any copy of the containing object will deep-copy all the autoclone_ptr-referenced objects avoid any accidental shallow copy aliasing or slicing (particularly useful for dynamic classes).