-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support describing concepts in source-to-asciidoc transfomation #675
Comments
Yes. We already extract the concepts (https://github.com/cppalliance/mrdocs/blob/develop/include/mrdocs/Metadata/Concept.hpp) and the XML generator already includes this information (https://github.com/cppalliance/mrdocs/blob/develop/test-files/golden-tests/concept.cpp / https://github.com/cppalliance/mrdocs/blob/develop/test-files/golden-tests/concept.xml). But that's recent work, so there's no asciidoc template yet. |
Will the following concept definition and annotations be documented? /** Requirements on a mark policy
@tparam MP mark policy
*/
template <typename MP>
concept mark_policy =
requires
{
/// type of the _logical value_
typename MP::value_type;
/// type of the value used for the actual storage
typename MP::storage_type;
/// type used for the return type of `markable::value()`
typename MP::reference_type;
/// type of the _representation value_
typename MP::representation_type;
} &&
requires(const typename MP::representation_type & cr,
typename MP::representation_type && rr,
const typename MP::storage_type & s,
const typename MP::value_type & cv,
typename MP::value_type && rv)
{
/// Returns the representation value representing a marked value
{ MP::marked_value() }
-> ::std::convertible_to<typename MP::representation_type>;
/// Checks if the representation value represents a marked value
{ MP::is_marked_value(cr) }
-> ::std::convertible_to<bool>;
/** Given a value of the storage type, provides access to the logical value
@pre: `!MP::is_marked_value(MP::representation(s))` is `true`.
*/
{ MP::access_value(s) }
-> ::std::same_as<typename MP::reference_type>;
/// Given a value of the storage type, provides access to the representation value
{ MP::representation(s) }
-> ::std::same_as<const typename MP::representation_type &>;
/// Encodes the provided logical value in the storage type
{ MP::store_value(cv) }
-> ::std::convertible_to<typename MP::storage_type>;
/// Encodes the provided logical value in the storage type
{ MP::store_value(::std::move(rv)) }
-> ::std::convertible_to<typename MP::storage_type>;
/// Encodes the provided representation value in the storage type
{ MP::store_representation(cr) }
-> ::std::convertible_to<typename MP::storage_type>;
/// Encodes the provided representation value in the storage type
{ MP::store_representation(::std::move(rr)) }
-> ::std::convertible_to<typename MP::storage_type>;
}; |
I believe it would extract the concepts but only include it in the XML output for now. @sdkrystian ? |
I mean, the above exmple requires parsing preconditons of a single constraint. It also has two |
My current documentation (which I create manually) provides the definition of the concept, and then, for every constraint, a description is provided:
https://github.com/akrzemi1/markable/blob/master/documentation/reference.adoc#concept-mark_policy
Does something like this works, or could be made to work, in mrdocs?
The text was updated successfully, but these errors were encountered: