Giter Club home page Giter Club logo

arcana.cpp's Introduction

Arcana.cpp

Arcana is a collection of general purpose C++ utilities with no code that is specific to a particular project or specialized technology area, sort of like an extension to the STL. At present, the most notable of these utilities is the Arcana task library.

You can learn more about API usage in the arcana.cpp documentation.

Getting Started

  1. Clone the repo and checkout the master branch.
  2. Arcana depends on GSL, so be sure to update your submodules: git submodule update --init --recursive

Prerequisites

Visual Studio 2017

You will need the following optional components:

  • UWP
  • Windows 10 SDK
  • Android

You can add these to your Visual Studio installation via:

"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" modify ^
--installPath "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise" ^
--add Microsoft.VisualStudio.Component.UWP.Support ^
--add Microsoft.VisualStudio.Component.Windows10SDK.17134 ^
--add Component.Android.NDK.R15C ^
--add Component.Android.NDK.R15C_3264 ^
--add Component.Android.SDK19.Private ^
--add Component.Android.SDK21.Private ^
--add Component.Android.SDK22.Private ^
--add Component.Android.SDK23 ^
--add Component.Android.SDK23.Private ^
--add Component.Android.SDK25.Private ^
--add Component.MDD.Android

Installing

Build the Code

The code can be built from Visual Studio via:

  1. Open Source\Arcana.cpp.sln.
  2. Select a target configuration (e.g. Debug) and platform (e.g. x86).
  3. Build the solution.

Alternatively, the code can be built from the command line via:

  1. Open the Developer Command Prompt for VS 2017
  2. Type msbuild Source\Arcana.cpp.sln /p:Configuration=Release /p:Platform=x86

Replace Release and x86 with whatever configuration and platform you would like to build locally.

Running the tests

The unit tests can be run within Visual Studio via Test Explorer, or from the Developer Command Prompt for VS 2017 via:

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\TestPlatform\vstest.console.exe" .\BuildOutput\Debug\Win32\Arcana.UWP.Test\Bin\Arcana.UWP.Test.dll

Deployment

There is no official deployment mechanism available at this time.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

arcana.cpp does not use SemVer. Instead, it uses a version derived from the current date. Therefore, the version contains no semantic information.

Maintainers

With questions, please contact one of the maintainers:

Credits

Arcana owes especial thanks to:

Reporting Security Issues

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) at [email protected]. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.

arcana.cpp's People

Contributors

andrei-datcu avatar bghgary avatar bonnymahajan10 avatar cedricguillemet avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar ryantrem avatar sbtron avatar syntheticmagus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arcana.cpp's Issues

Add suspend/resume capability to dispatcher

Add the ability to suspend and resume execution from another thread by setting state (or taking a token or something) on a dispatcher, without having to interact directly with mutexes or locks.

Non-copyable return types fail to compile with arcana::expected continuations

Code:

arcana::make_task(arcana::inline_scheduler, arcana::cancellation::none(), []() {
    return std::make_unique<int>(1); })
.then(arcana::inline_scheduler, arcana::cancellation::none(), [](arcana::expected<std::unique_ptr<int>, std::exception_ptr>) {
    // do something
});

The compiler fails with a bunch of errors:

1>C:\GitHub\...\arcana.cpp\Source\Shared\arcana\threading\internal\callable_traits.h(33,1): error C2280: 'arcana::basic_expected<ResultT,ErrorT>::basic_expected(const arcana::basic_expected<ResultT,ErrorT> &)': attempting to reference a deleted function
1>        with
1>        [
1>            ResultT=std::unique_ptr<int,std::default_delete<int>>,
1>            ErrorT=std::exception_ptr
1>        ]
1>C:\GitHub\...\arcana.cpp\Source\Shared\arcana/expected.h(134,9): message : see declaration of 'arcana::basic_expected<ResultT,ErrorT>::basic_expected'
1>        with
1>        [
1>            ResultT=std::unique_ptr<int,std::default_delete<int>>,
1>            ErrorT=std::exception_ptr
1>        ]
1>C:\GitHub\...\arcana.cpp\Source\Shared\arcana/expected.h(134,9): message : 'arcana::basic_expected<ResultT,ErrorT>::basic_expected(const arcana::basic_expected<ResultT,ErrorT> &)': function was implicitly deleted because a data member invokes a deleted or inaccessible function 'std::variant<E,T>::variant(const std::variant<E,T> &)'
1>        with
1>        [
1>            ResultT=std::unique_ptr<int,std::default_delete<int>>,
1>            ErrorT=std::exception_ptr
1>        ]
1>        and
1>        [
1>            E=std::exception_ptr,
1>            T=std::unique_ptr<int,std::default_delete<int>>
1>        ]
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include\variant(1200,1): message : 'std::variant<E,T>::variant(const std::variant<E,T> &)': function was implicitly deleted because a base class invokes a deleted or inaccessible function 'std::_Non_trivial_move_assign<std::_Variant_destroy_layer_<E,T>,E,T>::_Non_trivial_move_assign(const std::_Non_trivial_move_assign<std::_Variant_destroy_layer_<E,T>,E,T> &)'
1>        with
1>        [
1>            E=std::exception_ptr,
1>            T=std::unique_ptr<int,std::default_delete<int>>
1>        ]
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include\xsmf_control.h(108,5): message : 'std::_Non_trivial_move_assign<std::_Variant_destroy_layer_<E,T>,E,T>::_Non_trivial_move_assign(const std::_Non_trivial_move_assign<std::_Variant_destroy_layer_<E,T>,E,T> &)': function was implicitly deleted because a base class invokes a deleted or inaccessible function 'std::_Deleted_copy_assign<std::_Variant_destroy_layer_<E,T>,E,T>::_Deleted_copy_assign(const std::_Deleted_copy_assign<std::_Variant_destroy_layer_<E,T>,E,T> &)'
1>        with
1>        [
1>            E=std::exception_ptr,
1>            T=std::unique_ptr<int,std::default_delete<int>>
1>        ]
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include\xsmf_control.h(87,5): message : 'std::_Deleted_copy_assign<std::_Variant_destroy_layer_<E,T>,E,T>::_Deleted_copy_assign(const std::_Deleted_copy_assign<std::_Variant_destroy_layer_<E,T>,E,T> &)': function was implicitly deleted because a base class invokes a deleted or inaccessible function 'std::_Non_trivial_move<std::_Variant_destroy_layer_<E,T>,E,T>::_Non_trivial_move(const std::_Non_trivial_move<std::_Variant_destroy_layer_<E,T>,E,T> &)'
1>        with
1>        [
1>            E=std::exception_ptr,
1>            T=std::unique_ptr<int,std::default_delete<int>>
1>        ]
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include\xsmf_control.h(49,5): message : 'std::_Non_trivial_move<std::_Variant_destroy_layer_<E,T>,E,T>::_Non_trivial_move(const std::_Non_trivial_move<std::_Variant_destroy_layer_<E,T>,E,T> &)': function was implicitly deleted because a base class invokes a deleted or inaccessible function 'std::_Variant_destroy_layer_<E,T>::_Variant_destroy_layer_(const std::_Variant_destroy_layer_<E,T> &)'
1>        with
1>        [
1>            E=std::exception_ptr,
1>            T=std::unique_ptr<int,std::default_delete<int>>
1>        ]
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include\variant(900,5): message : 'std::_Variant_destroy_layer_<E,T>::_Variant_destroy_layer_(const std::_Variant_destroy_layer_<E,T> &)': function was implicitly deleted because a base class invokes a deleted or inaccessible function 'std::_Variant_base<E,T>::_Variant_base(const std::_Variant_base<E,T> &)'
1>        with
1>        [
1>            E=std::exception_ptr,
1>            T=std::unique_ptr<int,std::default_delete<int>>
1>        ]
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include\variant(889,1): message : 'std::_Variant_base<E,T>::_Variant_base(const std::_Variant_base<E,T> &)': function was implicitly deleted because a base class invokes a deleted or inaccessible function 'std::_Variant_storage_<false,E,T>::_Variant_storage_(const std::_Variant_storage_<false,E,T> &)'
1>        with
1>        [
1>            E=std::exception_ptr,
1>            T=std::unique_ptr<int,std::default_delete<int>>
1>        ]
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include\variant(462,5): message : 'std::_Variant_storage_<false,E,T>::_Variant_storage_(const std::_Variant_storage_<false,E,T> &)': function was implicitly deleted because 'std::_Variant_storage_<false,E,T>' has a variant data member 'std::_Variant_storage_<false,E,T>::_Head' with a non-trivial copy constructor
1>        with
1>        [
1>            E=std::exception_ptr,
1>            T=std::unique_ptr<int,std::default_delete<int>>
1>        ]
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include\variant(440,32): message : see declaration of 'std::_Variant_storage_<false,E,T>::_Head'
1>        with
1>        [
1>            E=std::exception_ptr,
1>            T=std::unique_ptr<int,std::default_delete<int>>
1>        ]
1>C:\GitHub\...\arcana.cpp\Source\Shared\arcana\threading\internal\callable_traits.h(93,76): message : see reference to class template instantiation 'arcana::internal::invoke_result<Babylon::NativeEngine::CreateProgramAsync::<lambda_6608e28c770ddb71e53dbf1b183f985a>,std::integral_constant<bool,true>,arcana::basic_expected<ResultT,ErrorT>>' being compiled
1>        with
1>        [
1>            ResultT=std::unique_ptr<int,std::default_delete<int>>,
1>            ErrorT=std::exception_ptr
1>        ]
1>C:\GitHub\...\arcana.cpp\Source\Shared\arcana/threading/task.h(97,85): message : see reference to class template instantiation 'arcana::internal::callable_traits<CallableT,std::unique_ptr<int,std::default_delete<int>>>' being compiled
1>        with
1>        [
1>            CallableT=Babylon::NativeEngine::CreateProgramAsync::<lambda_6608e28c770ddb71e53dbf1b183f985a>
1>        ]
1>D:\GitHub\Redacted.cpp: message : see reference to function template instantiation 'auto arcana::task<ReturnT,ErrorT>::then<const arcana::`anonymous-namespace'::<lambda_09644cad24fe5c20c9ec8e4fb6b7f66c>,Babylon::NativeEngine::CreateProgramAsync::<lambda_6608e28c770ddb71e53dbf1b183f985a>>(SchedulerT &,arcana::cancellation &,CallableT &&)' being compiled
1>        with
1>        [
1>            ReturnT=std::unique_ptr<int,std::default_delete<int>>,
1>            ErrorT=std::exception_ptr,
1>            SchedulerT=const arcana::`anonymous-namespace'::<lambda_09644cad24fe5c20c9ec8e4fb6b7f66c>,
1>            CallableT=Babylon::NativeEngine::CreateProgramAsync::<lambda_6608e28c770ddb71e53dbf1b183f985a>
1>        ]
1>C:\GitHub\...\arcana.cpp\Source\Shared\arcana\threading\internal\callable_traits.h(34,1): error C2280: 'arcana::basic_expected<ResultT,ErrorT>::basic_expected(const arcana::basic_expected<ResultT,ErrorT> &)': attempting to reference a deleted function
1>        with
1>        [
1>            ResultT=std::unique_ptr<int,std::default_delete<int>>,
1>            ErrorT=std::exception_ptr
1>        ]
1>C:\GitHub\...\arcana.cpp\Source\Shared\arcana/expected.h(134,9): message : see declaration of 'arcana::basic_expected<ResultT,ErrorT>::basic_expected'
1>        with
1>        [
1>            ResultT=std::unique_ptr<int,std::default_delete<int>>,
1>            ErrorT=std::exception_ptr
1>        ]
1>C:\GitHub\...\arcana.cpp\Source\Shared\arcana/expected.h(134,9): message : 'arcana::basic_expected<ResultT,ErrorT>::basic_expected(const arcana::basic_expected<ResultT,ErrorT> &)': function was implicitly deleted because a data member invokes a deleted or inaccessible function 'std::variant<E,T>::variant(const std::variant<E,T> &)'
1>        with
1>        [
1>            ResultT=std::unique_ptr<int,std::default_delete<int>>,
1>            ErrorT=std::exception_ptr
1>        ]
1>        and
1>        [
1>            E=std::exception_ptr,
1>            T=std::unique_ptr<int,std::default_delete<int>>
1>        ]
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include\variant(1200,1): message : 'std::variant<E,T>::variant(const std::variant<E,T> &)': function was implicitly deleted because a base class invokes a deleted or inaccessible function 'std::_Non_trivial_move_assign<std::_Variant_destroy_layer_<E,T>,E,T>::_Non_trivial_move_assign(const std::_Non_trivial_move_assign<std::_Variant_destroy_layer_<E,T>,E,T> &)'
1>        with
1>        [
1>            E=std::exception_ptr,
1>            T=std::unique_ptr<int,std::default_delete<int>>
1>        ]
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include\xsmf_control.h(108,5): message : 'std::_Non_trivial_move_assign<std::_Variant_destroy_layer_<E,T>,E,T>::_Non_trivial_move_assign(const std::_Non_trivial_move_assign<std::_Variant_destroy_layer_<E,T>,E,T> &)': function was implicitly deleted because a base class invokes a deleted or inaccessible function 'std::_Deleted_copy_assign<std::_Variant_destroy_layer_<E,T>,E,T>::_Deleted_copy_assign(const std::_Deleted_copy_assign<std::_Variant_destroy_layer_<E,T>,E,T> &)'
1>        with
1>        [
1>            E=std::exception_ptr,
1>            T=std::unique_ptr<int,std::default_delete<int>>
1>        ]
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include\xsmf_control.h(87,5): message : 'std::_Deleted_copy_assign<std::_Variant_destroy_layer_<E,T>,E,T>::_Deleted_copy_assign(const std::_Deleted_copy_assign<std::_Variant_destroy_layer_<E,T>,E,T> &)': function was implicitly deleted because a base class invokes a deleted or inaccessible function 'std::_Non_trivial_move<std::_Variant_destroy_layer_<E,T>,E,T>::_Non_trivial_move(const std::_Non_trivial_move<std::_Variant_destroy_layer_<E,T>,E,T> &)'
1>        with
1>        [
1>            E=std::exception_ptr,
1>            T=std::unique_ptr<int,std::default_delete<int>>
1>        ]
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include\xsmf_control.h(49,5): message : 'std::_Non_trivial_move<std::_Variant_destroy_layer_<E,T>,E,T>::_Non_trivial_move(const std::_Non_trivial_move<std::_Variant_destroy_layer_<E,T>,E,T> &)': function was implicitly deleted because a base class invokes a deleted or inaccessible function 'std::_Variant_destroy_layer_<E,T>::_Variant_destroy_layer_(const std::_Variant_destroy_layer_<E,T> &)'
1>        with
1>        [
1>            E=std::exception_ptr,
1>            T=std::unique_ptr<int,std::default_delete<int>>
1>        ]
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include\variant(900,5): message : 'std::_Variant_destroy_layer_<E,T>::_Variant_destroy_layer_(const std::_Variant_destroy_layer_<E,T> &)': function was implicitly deleted because a base class invokes a deleted or inaccessible function 'std::_Variant_base<E,T>::_Variant_base(const std::_Variant_base<E,T> &)'
1>        with
1>        [
1>            E=std::exception_ptr,
1>            T=std::unique_ptr<int,std::default_delete<int>>
1>        ]
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include\variant(889,1): message : 'std::_Variant_base<E,T>::_Variant_base(const std::_Variant_base<E,T> &)': function was implicitly deleted because a base class invokes a deleted or inaccessible function 'std::_Variant_storage_<false,E,T>::_Variant_storage_(const std::_Variant_storage_<false,E,T> &)'
1>        with
1>        [
1>            E=std::exception_ptr,
1>            T=std::unique_ptr<int,std::default_delete<int>>
1>        ]
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include\variant(462,5): message : 'std::_Variant_storage_<false,E,T>::_Variant_storage_(const std::_Variant_storage_<false,E,T> &)': function was implicitly deleted because 'std::_Variant_storage_<false,E,T>' has a variant data member 'std::_Variant_storage_<false,E,T>::_Head' with a non-trivial copy constructor
1>        with
1>        [
1>            E=std::exception_ptr,
1>            T=std::unique_ptr<int,std::default_delete<int>>
1>        ]
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include\variant(440,32): message : see declaration of 'std::_Variant_storage_<false,E,T>::_Head'
1>        with
1>        [
1>            E=std::exception_ptr,
1>            T=std::unique_ptr<int,std::default_delete<int>>
1>        ]

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.