Skip to content

Latest commit

 

History

History
85 lines (78 loc) · 5.09 KB

README.org

File metadata and controls

85 lines (78 loc) · 5.09 KB

https://travis-ci.org/FirstLoveLife/Faiz.svg?branch=master

WIP

this project is still working-in-progress

Different behavior from c++ standard library

unique_ptr

compare functions for array

don’t support arrray-compare free functions. IOW, Faiz::unique_ptr doesn’t support https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/testsuite/20_util/unique_ptr/specialized_algorithms/comparisons_array.cc Why? you know, compare array with operator </>/<=/>=...... make no sense at all. But why does the standard library support? Because they are free functions, rather than friend/member function, and array version of `class_unique_ptr<T[], Deleter>` is specializeed template, so it can use primary template’s free function. How do I disable them? change free functions into friend function with class totally_ordered, but operator < and operator == are still free functions now.

Modern stuff

Catch2

  • STATIC_REQUIRE

http://blog.nuggetwheat.org/index.php/2015/09/01/why-pointer_traits-was-introduced-in-c11/

  • implement list with pointer traits
  • use gsl’s Expects(preconditions) and Ensures(postconditions)
  • use gcc/clang’s modules.
  • simplify empty base classes once no_unique_address is available on clang.(it is available on gcc now though)
  • use explicit(bool) for pair/tuple once it is available.(gcc 9 has this feature, but I’m too lazy to compile it myself, clang doesn’t work on it yet).
  • add `ssize` function http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1227r0.html
  • implement useable common_type

papers to read

Conversion

  • typename or class? use class for sfinae(template parameter) and nest template, otherwise use typename
  • Faiz::index for all container indexes/subscripts/sizes, IOW, Don’t use unsigned for subscripts, prefer gsl::index
  • prefer and/or to &&/||, preserve && for rvalue reference.
  • Geneally, I prefer metafunction over free constexpr function, because the formmer can do more.
  • Prefer enable_if in function’s template parameter variable.

, see also isocpp/CppCoreGuidelines#1115

Travis-CI

oscompiler
Linuxg++-8
Linuxclang++-9
osxg++-8
osxClang++-8
windowsMinGw

Acknowledgements

I can’t finish a project without stealing code around, so here are the main sources of the code that can be found in this projects when I didn’t write it by myself:

  • A great deal of code originally comes from the libcxx/libstdcxx/cppreference implementation of type_traits(rewrite many of them with void_t/detectiom idiom)
  • many macros in faiz_fwd.hpp is mainly from range-v3 and yslib
  • operators.hpp comes from tao-operators, but rerwite some of codes with cpp17, and remove support for return rvalue reference.
  • compressed_pair.hpp is adapted from https://github.com/Morwenn/tight_pair/
  • The tests in tests were preliminary tests adapted from libcxx/libstdcxx/tight_pair/tao-operators/range-v3/boost

used c++2a features

  • std::endian

Papers

license

This library includes(and are most modified heavily) third party open source software components:

  • libcxx and libstdcxx(for test files and some traits)
  • YSLib
  • tight_pair(compressed_pair.hpp, for ebco and test cases)
  • range-v3(for utilities like is_swappable and some meta functions), and
  • Catch2(for write test files)
  • boost(esp for boost.pp and boost.boost.predef)
  • tao-operators(for compare functions, can be replaced with three-way comparison if it is available.).

All files mentioned below preserve original copyright at topmost

Who is Faiz?

Kamen Rider Faiz (仮面ライダーファイズ Kamen Raidā Faizu, Masked Rider Faiz) is the main protagonist of the 2003-2004 Kamen Rider Series installment Kamen Rider 555. Its gear is the first of the Rider Gears seen in the series. Its motif is based on the Greek letter phi (Φ).

faiz.jpg