From bec4e0953178423e9b01615975ad8335a663ce74 Mon Sep 17 00:00:00 2001 From: Determinant Date: Sat, 3 Feb 2018 20:31:00 -0500 Subject: ... --- .travis.yml | 2 +- README.rst | 12 ++++++------ promise.hpp | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index d7971ee..cd8cff8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,7 +49,7 @@ before_install: - eval "${MATRIX_EVAL}" install: - - sudo apt-get install libboost-all-dev + - sudo apt-get install libboost-all-dev script: - make diff --git a/README.rst b/README.rst index 8f4bc46..3a95254 100644 --- a/README.rst +++ b/README.rst @@ -11,7 +11,7 @@ types do not match the types expected in the subsequent computation. See API === -:: +.. code-block:: cpp typename promise_t(Func callback); @@ -20,7 +20,7 @@ immediately after the object is constructed, so usually the user registers ``pm`` to some external logic which triggers ``pm.resolve()`` or ``pm.reject()`` when the time comes. -:: +.. code-block:: cpp template resolve(T result) const; @@ -28,7 +28,7 @@ Resolve the promise with value ``result``. This may trigger the other promises waiting for the current promise recursively. When a promise is triggered, the registered ``on_fulfilled()`` function will be invoked using ``result`` as the argument. -:: +.. code-block:: cpp tempalte reject(T reason) const; @@ -36,7 +36,7 @@ Reject the promise with value ``result``. This may reject the other promises waiting for the current promise recursively. When a promise is rejected, the registered ``on_rejected()`` function will be invoked using ``reason`` as the argument. -:: +.. code-block:: cpp template promise_t then(FuncFulfilled on_fulfilled) const; @@ -46,7 +46,7 @@ Create a new promise that waits for the resolution of the current promise. resolved. The rejection will skip the callback and pass on to the promises that follow the created promise. -:: +.. code-block:: cpp template promise_t fail(FuncRejected on_rejected) const; @@ -56,7 +56,7 @@ Create a new promise that waits for the rejection of the current promise. rejected. The resolution will skip the callback and pass on to the promises that follow the created promise. -:: +.. code-block:: cpp template inline promise_t then(FuncFulfilled on_fulfilled, diff --git a/promise.hpp b/promise.hpp index 1173e87..ae77c43 100644 --- a/promise.hpp +++ b/promise.hpp @@ -29,6 +29,7 @@ #include #include +#if __cplusplus >= 201703L #ifdef __has_include # if __has_include() # include @@ -37,6 +38,7 @@ # endif # endif #endif +#endif #ifndef _CPPROMISE_STD_ANY #include -- cgit v1.2.3 From 4d9874ddd3206ec8da515ddf9042798cd7f6a12c Mon Sep 17 00:00:00 2001 From: Ted Yin Date: Sat, 3 Feb 2018 20:50:56 -0500 Subject: Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..21e2a1b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Ted Yin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. -- cgit v1.2.3