Move the documentation code to doc

This commit is contained in:
Denis Blank 2017-10-04 18:52:38 +02:00
parent 425d922965
commit 2b061a6058
12 changed files with 21 additions and 2514 deletions

View File

@ -58,7 +58,7 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
include(cmake/CMakeLists.txt) include(cmake/CMakeLists.txt)
add_subdirectory(doc)
add_subdirectory(examples) add_subdirectory(examples)
add_subdirectory(test) add_subdirectory(test)
endif () endif ()

1
doc/CMakeLists.txt Normal file
View File

@ -0,0 +1 @@
add_subdirectory(code)

File diff suppressed because it is too large Load Diff

2
doc/code/CMakeLists.txt Normal file
View File

@ -0,0 +1,2 @@
add_subdirectory(documentation)
add_subdirectory(slideshow)

View File

@ -0,0 +1,5 @@
add_executable(doc-documentation
${CMAKE_CURRENT_LIST_DIR}/doc-documentation.cpp)
target_link_libraries(doc-documentation
PRIVATE
continuable)

View File

@ -0,0 +1,5 @@
add_executable(doc-slideshow
${CMAKE_CURRENT_LIST_DIR}/doc-slideshow.cpp)
target_link_libraries(doc-slideshow
PRIVATE
continuable)

View File

@ -1,2 +0,0 @@
add_subdirectory(documentation)
add_subdirectory(slideshow)

View File

@ -1,5 +0,0 @@
add_executable(example-documentation
${CMAKE_CURRENT_LIST_DIR}/example-documentation.cpp)
target_link_libraries(example-documentation
PRIVATE
continuable)

View File

@ -1,5 +0,0 @@
add_executable(example-slideshow
${CMAKE_CURRENT_LIST_DIR}/example-slideshow.cpp)
target_link_libraries(example-slideshow
PRIVATE
continuable)

View File

@ -579,8 +579,8 @@ private:
/// which represents the object invokable with the asynchronous result of this /// which represents the object invokable with the asynchronous result of this
/// continuable. /// continuable.
/// ```cpp /// ```cpp
/// auto ct = cti::make_continuable([](auto&& callback) { /// auto ct = cti::make_continuable([](auto&& promise) {
/// std::forward<decltype(callback)>(callback)("result"); /// promise.set_value("result");
/// }); /// });
/// ``` /// ```
/// The callback may be stored or moved. /// The callback may be stored or moved.
@ -589,14 +589,14 @@ private:
/// It's recommended to accept any callback instead of erasing it. /// It's recommended to accept any callback instead of erasing it.
/// ```cpp /// ```cpp
/// // Good practice: /// // Good practice:
/// auto ct = cti::make_continuable([](auto&& callback) { /// auto ct = cti::make_continuable([](auto&& promise) {
/// std::forward<decltype(callback)>(callback)("result"); /// promise.set_value("result");
/// }); /// });
/// ///
/// // Good practice using a functional object: /// // Good practice using a functional object:
/// struct Continuation { /// struct Continuation {
/// template<typename T> /// template<typename T>
/// void operator() (T&& continuation) const { /// void operator() (T&& continuation) && {
/// // ... /// // ...
/// } /// }
/// } /// }
@ -605,8 +605,8 @@ private:
/// ///
/// // Bad practice (because of unnecessary type erasure): /// // Bad practice (because of unnecessary type erasure):
/// auto ct = cti::make_continuable( /// auto ct = cti::make_continuable(
/// [](std::function<void(std::string)> callback) { /// [](cti::promise<std::string> promise) {
/// callback("result"); /// promise.set_value("result");
/// }); /// });
/// ``` /// ```
/// ///