GithubHelp home page GithubHelp logo

zwhfly / any Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thelink2012/any

0.0 2.0 0.0 13 KB

Implementation of std::experimental::any, including small object optimization, for C++11 compilers

License: Boost Software License 1.0

CMake 0.88% C++ 99.12%

any's Introduction

Any

This is a implementation of N4562 std::experimental::any (merged into C++17) for C++11 compilers.

It contains a small object optimization for objects with a size of up to 2 words (such as int, float and std::shared_ptr). Storing those objects in the container will not trigger a dynamic allocation.

For a easy to understand documentation, see cppreference, except our namespace is linb.

Defines

You may additionally define the following preprocessor symbols (making the implementation non-standard):

  • ANY_IMPL_ANY_CAST_MOVEABLE: This implements a fix proposed in LWG Defect 2509. This will cause the expressions T x = any_cast<T>(any(T())) and T x = any_cast<T&&>(any(T()))to perform a move into x instead of a copy.
  • ANY_IMPL_FAST_TYPE_INFO_COMPARE: When checking if two typeid are the same, performs just a pointer comparision instead of the actual type_info::operator== comparision. Be aware this isn't recommended unless you know what you're doing.

any's People

Contributors

thelink2012 avatar zwhfly avatar

Watchers

 avatar  avatar

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.