mirror of
https://github.com/Naios/continuable.git
synced 2025-12-06 16:56:44 +08:00
Move the documentation code to doc
This commit is contained in:
parent
425d922965
commit
2b061a6058
@ -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
1
doc/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
add_subdirectory(code)
|
||||||
2494
doc/Doxyfile
2494
doc/Doxyfile
File diff suppressed because it is too large
Load Diff
2
doc/code/CMakeLists.txt
Normal file
2
doc/code/CMakeLists.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
add_subdirectory(documentation)
|
||||||
|
add_subdirectory(slideshow)
|
||||||
5
doc/code/documentation/CMakeLists.txt
Normal file
5
doc/code/documentation/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
add_executable(doc-documentation
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/doc-documentation.cpp)
|
||||||
|
target_link_libraries(doc-documentation
|
||||||
|
PRIVATE
|
||||||
|
continuable)
|
||||||
5
doc/code/slideshow/CMakeLists.txt
Normal file
5
doc/code/slideshow/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
add_executable(doc-slideshow
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/doc-slideshow.cpp)
|
||||||
|
target_link_libraries(doc-slideshow
|
||||||
|
PRIVATE
|
||||||
|
continuable)
|
||||||
@ -1,2 +0,0 @@
|
|||||||
add_subdirectory(documentation)
|
|
||||||
add_subdirectory(slideshow)
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
add_executable(example-documentation
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/example-documentation.cpp)
|
|
||||||
target_link_libraries(example-documentation
|
|
||||||
PRIVATE
|
|
||||||
continuable)
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
add_executable(example-slideshow
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/example-slideshow.cpp)
|
|
||||||
target_link_libraries(example-slideshow
|
|
||||||
PRIVATE
|
|
||||||
continuable)
|
|
||||||
@ -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");
|
||||||
/// });
|
/// });
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user