mirror of
https://gitee.com/openharmony/third_party_rust_cxx
synced 2024-11-23 07:10:29 +00:00
Update C++ formatting to clang-format 11
This commit is contained in:
parent
5d12f1d4c5
commit
de01edf706
@ -88,7 +88,7 @@ public:
|
||||
json(const json &) = default;
|
||||
json(json &&) = default;
|
||||
template <typename... T>
|
||||
json(T &&... value) : value(std::forward<T>(value)...) {}
|
||||
json(T &&...value) : value(std::forward<T>(value)...) {}
|
||||
|
||||
bool isNull() const;
|
||||
bool isNumber() const;
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
void push_back(const T &value);
|
||||
void push_back(T &&value);
|
||||
template <typename... Args>
|
||||
void emplace_back(Args &&... args);
|
||||
void emplace_back(Args &&...args);
|
||||
|
||||
class iterator;
|
||||
iterator begin() noexcept;
|
||||
|
@ -316,7 +316,7 @@ public:
|
||||
void push_back(const T &value);
|
||||
void push_back(T &&value);
|
||||
template <typename... Args>
|
||||
void emplace_back(Args &&... args);
|
||||
void emplace_back(Args &&...args);
|
||||
|
||||
using iterator = typename Slice<T>::iterator;
|
||||
iterator begin() noexcept;
|
||||
@ -766,7 +766,7 @@ T &Box<T>::operator*() noexcept {
|
||||
|
||||
template <typename T>
|
||||
template <typename... Fields>
|
||||
Box<T> Box<T>::in_place(Fields &&... fields) {
|
||||
Box<T> Box<T>::in_place(Fields &&...fields) {
|
||||
allocation alloc;
|
||||
auto ptr = alloc.ptr;
|
||||
::new (ptr) T{std::forward<Fields>(fields)...};
|
||||
@ -920,7 +920,7 @@ void Vec<T>::push_back(T &&value) {
|
||||
|
||||
template <typename T>
|
||||
template <typename... Args>
|
||||
void Vec<T>::emplace_back(Args &&... args) {
|
||||
void Vec<T>::emplace_back(Args &&...args) {
|
||||
auto size = this->size();
|
||||
this->reserve_total(size + 1);
|
||||
::new (reinterpret_cast<T *>(reinterpret_cast<char *>(this->data()) +
|
||||
|
@ -66,7 +66,7 @@ void panic [[noreturn]] (const char *msg) {
|
||||
#endif
|
||||
}
|
||||
|
||||
template void panic<std::out_of_range>[[noreturn]] (const char *msg);
|
||||
template void panic<std::out_of_range> [[noreturn]] (const char *msg);
|
||||
|
||||
String::String() noexcept { cxxbridge1$string$new(this); }
|
||||
|
||||
|
@ -779,14 +779,14 @@ extern "C" const char *cxx_run_test() noexcept {
|
||||
bool (rust::String::*cmp)(const rust::String &) const;
|
||||
bool first_first, first_second, sec_second, second_sec;
|
||||
for (auto test : {
|
||||
std::tuple<decltype(cmp), bool, bool, bool, bool>
|
||||
{&rust::String::operator==, true, false, false, false},
|
||||
{&rust::String::operator!=, false, true, true, true},
|
||||
{&rust::String::operator<, false, true, true, false},
|
||||
{&rust::String::operator<=, true, true, true, false},
|
||||
{&rust::String::operator>, false, false, false, true},
|
||||
{&rust::String::operator>=, true, false, false, true},
|
||||
}) {
|
||||
std::tuple<decltype(cmp), bool, bool, bool, bool>{
|
||||
&rust::String::operator==, true, false, false, false},
|
||||
{&rust::String::operator!=, false, true, true, true},
|
||||
{&rust::String::operator<, false, true, true, false},
|
||||
{&rust::String::operator<=, true, true, true, false},
|
||||
{&rust::String::operator>, false, false, false, true},
|
||||
{&rust::String::operator>=, true, false, false, true},
|
||||
}) {
|
||||
std::tie(cmp, first_first, first_second, sec_second, second_sec) = test;
|
||||
ASSERT((first.*cmp)(first) == first_first);
|
||||
ASSERT((first.*cmp)(second) == first_second);
|
||||
|
Loading…
Reference in New Issue
Block a user