Code Monkey home page Code Monkey logo

supportclasslibrary's Introduction

Support Class Library

WARNING: This is currently a Work In Progress

The SCL is a set of tools providing classes and utility functions that aim to ease the development of your applications.

You can have a look at the documentation here.

Organisation

Here is the namespace hierarchy:

  • scl - The englobing namespace
    • concepts - A concept-like library based around static_assert (mostly implemented as defined in cppreference)
    • tools - General purpose utility functions
    • exceptions - Exception types used in the library
    • utils - Utility classes (and rare functions), eg. Any or Opiontal or eventoString
    • stream - The stream API exposing stream creators, operations and terminators
      • details - Implementation details for streams (including the base iterator types)
      • creators - Grouping stream creation functions
      • operators - Grouping intermediate stream operation functions
      • terminators - Grouping end of stream operation functions
    • async - The asynchronous programming API
    • http - The HTTP API
    • detect - The feature/platform detection API

Here are some macros and their meaning:

  • Code based macros
    • realConst(type) - Gives a const version of the given type (equivalent to const type const, useful for pointers)
    • stringLiteral - The actual string literal type (so you don't have to learn it by heart)
    • assert_concept - Compile time assertions of concepts outside of a block of code (must be simple concepts, not aggregates (e.g. Copyable vs Invocable))
    • static_require - Require concepts without giving an additional error message
    • META - The fully qualified namespace path to the meta namespace (actually is scl::tools::meta)
    • asString - The function that converts a variable to std::string using its ToString specialization
  • Flags
    • SCL_CPP14 - Define this flag to use the C++14 add-ons (e.g. is_final_t)
    • SCL_CPP17 - Define this flag to use the C++17 add-ons (e.g. is_swappable_t)
    • SCL_CONCEPTS_REQUIRE_IS_VOID - Define this flag to replace constexpr bool require() with constexpr void require()
    • SCL_USE_IOSTREAM_EXTEND - Define this flag if you wish to use the general purpose operator<< for ostream that uses std::to_string and scl::utils::toString for conversions
    • SCL_ENABLE_DEPRECATED_TYPEMODS - Define this flag if you wish to define the deprecated typemods (e.g. result_of_t)
    • SCL_ENABLE_DEPRECATED_TYPECHECKS - Define this flag if you wish to define the deprecated typechecks (e.g. is_pod_t)
    • SCL_KEEP_DETECT_MACROS - Define this flag if you wish to keep the macros for scl::detect defined

supportclasslibrary's People

Contributors

voltra avatar

Watchers

 avatar  avatar

supportclasslibrary's Issues

Rework Concepts

Currently concepts work on a static_assert basis, which makes it harder to give a proper "stack-trace" of concept requirements failing.

  • [ ] Add constexpr void check()
  • Remove the macro-based void/bool and keep it bool based
  • Add concepts from C++20
  • Add all iterator concepts

STL Aliases

  • scl::alias::Map for std::unordered_map
  • scl::alias::Set for std::unordered_set
  • scl::alias::SortedSet for std::set
  • scl::alias::SortedMap for std::map
  • shorthands for integral types

Prelude

Add a prelude namespace that "reexports" the most important pieces

Stringifier

  • make stringifier type
  • make toString templated function
  • auto-define type for
    • std::to_string implementations
    • .c_str()
    • .str()
    • .toString()
  • auto define operator<< for std::ostream
  • auto define std::to_string for types that can toString

Streams

Make batch processing reduced to a single for-loop

  • Define creators types
    • from iterator pair
    • from std::array
    • from std::istream (at least std::ifstream)
    • from container
    • range
      • inclusive
      • semi-inclusive (both sides)
      • exclusive
  • Define operator types
    • map
    • filter
    • unique(By)
  • Define terminator types
    • reduce
    • count
    • presence tests (all, any, one, none, notAll)
    • packing
      • STL containers
      • lambda based
  • Enable parallelism/multi-threading
  • Maybe abuse the shit out of ADL for god-tier autocomplete

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.