Releases: dtolnay/cxx
Releases · dtolnay/cxx
1.0.14
- Support Vec<T> where T is a shared struct from a different bridge module (#535)
- Support explicit impls
impl Vec<T> {}andimpl Box<T> {}(#542, #555) - Fix missing imports when generating C++
std::hashtemplate specialization via#[derive(Hash)](#556, #557) - Respect class-specific member
operator newin the implementation of UniquePtr::new (#553) - Support reuse of non-POD shared types by value across bridge modules (#551, #559, #560)
1.0.13
1.0.12
1.0.11
1.0.10
1.0.9
-
Support
derive(PartialOrd, Ord)on shared enums -
Add non-const indexing overloads for
rust::Vec<T>in C++: https://cxx.rs/binding/vec.htmlconst T &operator[](size_t n) const noexcept; const T &at(size_t n) const; const T &front() const; const T &back() const; + T &operator[](size_t n) noexcept; + T &at(size_t n); + T &front(); + T &back();
1.0.8
1.0.7
1.0.6
- Connect standard library derives on shared types to C++ operator overloads (#518, #519, #520, #521, #522)
derive(PartialEq)on the Rust side turns into C++operator==andoperator!=derive(PartialOrd)turns intooperator<,operator<=,operator>,operator>=derive(Hash)turns into a specialization oftemplate <> struct std::hash<T>
#[cxx::bridge]
mod ffi {
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Default, Debug)]
struct AllTheDerives {
x: i32,
y: i32,
}
}// generated
struct AllTheDerives final {
int32_t x;
int32_t y;
bool operator==(const AllTheDerives &) const noexcept;
bool operator!=(const AllTheDerives &) const noexcept;
bool operator<(const AllTheDerives &) const noexcept;
bool operator<=(const AllTheDerives &) const noexcept;
bool operator>(const AllTheDerives &) const noexcept;
bool operator>=(const AllTheDerives &) const noexcept;
};
namespace std {
template <> struct hash<AllTheDerives> {
size_t operator()(const AllTheDerives &self) const noexcept;
};
}1.0.5
-
Add mutable iterators for
rust::Vec<T>in C++ (#509)class Vec<T> { + class iterator; + iterator begin() noexcept; + iterator end() noexcept; class const_iterator; const_iterator begin() const noexcept; const_iterator end() const noexcept; + const_iterator cbegin() const noexcept; + const_iterator cend() const noexcept; }; -
Support slices with arbitrary element type (previously restricted to
u8) (#514) -
Add
c_chartype which refers tostd::os::raw::c_charin Rust andcharin C++ (#515) -
Add iterator for
rust::Slice<T>andrust::Slice<const T>(#516)class Slice<T> { + class iterator; + iterator begin() const noexcept; + iterator end() const noexcept; }; -
Add iterators for
rust::Stringandrust::Str(#517)class String { + using iterator = char *; + iterator begin() noexcept; + iterator end() noexcept; + using const_iterator = const char *; + const_iterator begin() const noexcept; + const_iterator end() const noexcept; + const_iterator cbegin() const noexcept; + const_iterator cend() const noexcept; }; class Str { + using iterator = const char *; + using const_iterator = const char *; + const_iterator begin() const noexcept; + const_iterator end() const noexcept; + const_iterator cbegin() const noexcept; + const_iterator cend() const noexcept; };