Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rules/cstddef/src.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <cstddef>

#if __cplusplus >= 201703L
using t1 = std::byte;

std::byte f1(const std::byte &a0, unsigned a1) { return operator<<(a0, a1); }
Expand All @@ -12,3 +13,4 @@ std::byte f2(const std::byte &a0, unsigned a1) { return operator>>(a0, a1); }
std::byte f3(std::byte &a0, unsigned a1) { return operator<<=(a0, a1); }

std::byte f4(std::byte &a0, unsigned a1) { return operator>>=(a0, a1); }
#endif
2 changes: 2 additions & 0 deletions rules/new/src.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ void *f3(std::size_t a0) { return ::operator new[](a0); }

void f4(void *a0) { return ::operator delete[](a0); }

#if __cplusplus >= 201703L
template <typename T1> T1 *f5(T1 *a0) { return std::launder(a0); }
#endif
2 changes: 2 additions & 0 deletions rules/string/src.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ std::string &f4(std::string &s, const char *p, std::size_t n) {

const char *f5(const std::string &s) { return s.c_str(); }

#if __cplusplus >= 201703L
char *f6(std::string &s) { return s.data(); }
#endif

std::string f7(const char *s, std::size_t n) { return std::string(s, n); }

Expand Down
4 changes: 4 additions & 0 deletions rules/unique_ptr/src.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ template <typename T, typename A> using Init = A;
template <typename T1> using t1 = std::unique_ptr<T1>;
template <typename T1> using t2 = std::unique_ptr<T1[]>;

#if __cplusplus >= 201402L
template <typename T2, typename T1> std::unique_ptr<T1[]> f1(std::size_t n) {
return std::make_unique<T1[]>(n);
}
#endif

template <typename T1> T1 *f2(std::unique_ptr<T1> &o) { return o.get(); }

Expand All @@ -33,10 +35,12 @@ template <typename T1> void f6(std::unique_ptr<T1[]> &o, T1 *p) {

template <typename T1> T1 *f7(std::unique_ptr<T1[]> &o) { return o.get(); }

#if __cplusplus >= 201402L
template <typename T1, typename... Args>
std::unique_ptr<T1> f8(Init<T1, Args> &&...args) {
return std::make_unique<T1>(std::forward<Args>(args)...);
}
#endif

template <typename T1> void f9(std::unique_ptr<T1[]> &o) {
return o.reset(nullptr);
Expand Down
Loading