MeshLib C++ Docs
Loading...
Searching...
No Matches
MRResizeNoInit.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "MRMeshFwd.h"
4
#include "
MRMacros.h
"
5
#include <concepts>
6
7
namespace
MR
8
{
11
12
16
template
<
typename
T>
17
void
resizeNoInit
( std::vector<T> & vec,
size_t
targetSize )
MR_REQUIRES_IF_SUPPORTED
(
sizeof
( T ) > 0 && std::constructible_from<T, NoInit> )
18
{
20
vec.reserve( targetSize );
22
while
( vec.size() < targetSize )
23
vec.emplace_back( noInit );
25
vec.resize( targetSize );
26
}
27
28
}
MRMacros.h
MR_REQUIRES_IF_SUPPORTED
#define MR_REQUIRES_IF_SUPPORTED(...)
Definition
MRMacros.h:34
MR::resizeNoInit
void resizeNoInit(std::vector< T > &vec, size_t targetSize) MR_REQUIRES_IF_SUPPORTED(sizeof(T) > 0 &&std
Definition
MRResizeNoInit.h:17
MR
only for bindings generation
Definition
MRCameraOrientationPlugin.h:8
MeshLib
source
MRMesh
MRResizeNoInit.h
Generated by
1.11.0