mirror of
https://github.com/topjohnwu/cxx.git
synced 2025-02-23 01:21:42 +00:00
Consider T alignment for empty rust::Slice
This commit is contained in:
parent
71c7b45e4f
commit
7b16a39a02
@ -390,7 +390,7 @@ inline size_t Str::length() const noexcept { return this->len; }
|
||||
#ifndef CXXBRIDGE1_RUST_SLICE
|
||||
#define CXXBRIDGE1_RUST_SLICE
|
||||
template <typename T>
|
||||
Slice<T>::Slice() noexcept : ptr(reinterpret_cast<T *>(this)), len(0) {}
|
||||
Slice<T>::Slice() noexcept : ptr(reinterpret_cast<T *>(alignof(T))), len(0) {}
|
||||
|
||||
template <typename T>
|
||||
Slice<T>::Slice(T *s, size_t count) noexcept : ptr(s), len(count) {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user