Skip to content

Commit

Permalink
Housekeeping: Remove trailing whitespace (closes hsutter#1 and hsutter#2
Browse files Browse the repository at this point in the history
)

And fixed badge link
Thanks to @eyalz800 and @Zt-freak
  • Loading branch information
hsutter committed Sep 18, 2022
1 parent c78ac59 commit b06de46
Show file tree
Hide file tree
Showing 10 changed files with 488 additions and 492 deletions.
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Copyright (c) Herb Sutter
SPDX-License-Identifier: CC-BY-NC-ND-4.0
See [License](LICENSE)

[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)


# Contributor Covenant Code of Conduct
Expand Down
8 changes: 2 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@

## Contributing to cppfront

cppfront is the sole personal project of Herb Sutter.
cppfront is an personal experimental project of Herb Sutter.

NO commercial use. NO forks/derivatives.
At this time, the license is limited to no commercial use and no distributed forks/derivatives.

Please DO NOT open issues or submit PRs on this repo at this time.

The following is for the future when I may accept PRs.


## Contributor License Agreement
By contributing content to cppfront (i.e., submitting a pull request for inclusion in this repository):
- You warrant that your material is original, or you have the right to contribute it.
Expand Down
92 changes: 46 additions & 46 deletions README.md

Large diffs are not rendered by default.

90 changes: 45 additions & 45 deletions include/cpp2util.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#ifndef _MSC_VER
// This is the ideal -- note that we just voted "import std;"
// into draft C++23 in late July 2022, so implementers haven't
// into draft C++23 in late July 2022, so implementers haven't
// had time to catch up yet. As of this writing (September 2022)
// no compiler will take this path yet, but they're on the way...
import std;
Expand Down Expand Up @@ -204,9 +204,9 @@
namespace cpp2 {

//-----------------------------------------------------------------------
//
//
// contract_group
//
//
//-----------------------------------------------------------------------
//

Expand Down Expand Up @@ -255,30 +255,30 @@ class contract_group {
std::terminate();
}

auto inline Default = contract_group(
[](CPP2_MESSAGE_PARAM msg CPP2_SOURCE_LOCATION_PARAM)noexcept {
auto inline Default = contract_group(
[](CPP2_MESSAGE_PARAM msg CPP2_SOURCE_LOCATION_PARAM)noexcept {
report_and_terminate("Contract", msg CPP2_SOURCE_LOCATION_ARG);
}
);
auto inline Bounds = contract_group(
[](CPP2_MESSAGE_PARAM msg CPP2_SOURCE_LOCATION_PARAM)noexcept {
auto inline Bounds = contract_group(
[](CPP2_MESSAGE_PARAM msg CPP2_SOURCE_LOCATION_PARAM)noexcept {
report_and_terminate("Bounds safety", msg CPP2_SOURCE_LOCATION_ARG);
}
}
);
auto inline Null = contract_group(
[](CPP2_MESSAGE_PARAM msg CPP2_SOURCE_LOCATION_PARAM)noexcept {
auto inline Null = contract_group(
[](CPP2_MESSAGE_PARAM msg CPP2_SOURCE_LOCATION_PARAM)noexcept {
report_and_terminate("Null safety", msg CPP2_SOURCE_LOCATION_ARG);
}
}
);
auto inline Type = contract_group(
[](CPP2_MESSAGE_PARAM msg CPP2_SOURCE_LOCATION_PARAM)noexcept {
auto inline Type = contract_group(
[](CPP2_MESSAGE_PARAM msg CPP2_SOURCE_LOCATION_PARAM)noexcept {
report_and_terminate("Type safety", msg CPP2_SOURCE_LOCATION_ARG);
}
}
);
auto inline Testing = contract_group(
[](CPP2_MESSAGE_PARAM msg CPP2_SOURCE_LOCATION_PARAM)noexcept {
auto inline Testing = contract_group(
[](CPP2_MESSAGE_PARAM msg CPP2_SOURCE_LOCATION_PARAM)noexcept {
report_and_terminate("Testing", msg CPP2_SOURCE_LOCATION_ARG);
}
}
);

constexpr auto contract_group::set_handler(handler h) -> handler {
Expand Down Expand Up @@ -317,12 +317,12 @@ auto assert_in_bounds(auto&& x, auto&& arg CPP2_SOURCE_LOCATION_PARAM_WITH_DEFAU


//-----------------------------------------------------------------------
//
//
// Arena objects for std::allocators
//
//
// Note: cppfront translates "new" to "cpp2_new", so in Cpp2 code
// these are invoked by simply "unique.new<T>" etc.
//
//
//-----------------------------------------------------------------------
//
struct {
Expand All @@ -346,13 +346,13 @@ template<typename T, typename... Args>


//-----------------------------------------------------------------------
//
//
// in<T> For "in" parameter
//
//
//-----------------------------------------------------------------------
//
template<typename T>
using in =
using in =
std::conditional_t <
sizeof(T) < 2*sizeof(void*) && std::is_trivially_copy_constructible_v<T>,
T const,
Expand All @@ -361,19 +361,19 @@ using in =


//-----------------------------------------------------------------------
//
//
// Initialization: These are closely related...
//
//
// deferred_init<T> For deferred-initialized local or member variable
//
// out<T> For out parameter
//
//
//-----------------------------------------------------------------------
//
template<typename T>
class deferred_init {
bool init = false;
union {
union {
int i;
T t;
};
Expand Down Expand Up @@ -414,7 +414,7 @@ class out {
}
}

auto construct (auto ...args) -> void {
auto construct (auto ...args) -> void {
if (has_t) {
*t = T(args...);
}
Expand All @@ -427,7 +427,7 @@ class out {
}
}

auto construct_list(auto ...args) -> void {
auto construct_list(auto ...args) -> void {
if (has_t) {
*t = T{args...};
}
Expand All @@ -443,9 +443,9 @@ class out {


//-----------------------------------------------------------------------
//
//
// CPP2_UFCS: Variadic macro generating a variadic lamba, oh my...
//
//
//-----------------------------------------------------------------------
//
#define CPP2_UFCS(FUNCNAME,PARAM1,...) \
Expand All @@ -468,9 +468,9 @@ class out {


//-----------------------------------------------------------------------
//
//
// is and as
//
//
//-----------------------------------------------------------------------
//
//-------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -526,7 +526,7 @@ auto as( X const& x ) -> auto&& {
}

template< typename C, typename X >
auto as( X const& x ) -> auto
auto as( X const& x ) -> auto
requires (!std::is_same_v<C, X> && requires { C{x}; })
{
return C{x};
Expand Down Expand Up @@ -640,18 +640,18 @@ constexpr auto as( X const& x ) -> auto&&


//-----------------------------------------------------------------------
//
//
// A variation of GSL's final_action_success and finally to run only on success
// (based on a PR I contributed to Microsoft GSL)
//
//
// final_action_success_success ensures something is run at the end of a scope
// if no exception is thrown
//
//
// finally_success is a convenience function to make a final_action_success_success
//
//
//-----------------------------------------------------------------------
//

template <class F>
class final_action_success
{
Expand Down Expand Up @@ -688,9 +688,9 @@ template <class F>


//-----------------------------------------------------------------------
//
//
// to_string for string interpolation
//
//
//-----------------------------------------------------------------------
//
template<typename T>
Expand Down Expand Up @@ -725,18 +725,18 @@ using cpp2::cpp2_new;


//-----------------------------------------------------------------------
//
//
// A partial implementation of GSL features Cpp2 relies on,
// to keep this a standalone header without non-std dependencies
//
//
//-----------------------------------------------------------------------
//
namespace gsl {

//-----------------------------------------------------------------------
//
//
// An implementation of GSL's narrow_cast
//
//
//-----------------------------------------------------------------------
//
template<typename To, typename From>
Expand Down
Loading

0 comments on commit b06de46

Please sign in to comment.