hpp2plantuml icon indicating copy to clipboard operation
hpp2plantuml copied to clipboard

Support for template signatures

Open mxmlnkn opened this issue 3 years ago • 1 comments

Given this header:

template<
    typename Key,
    typename Value,
    typename CacheStrategy = CacheStrategy::LeastRecentlyUsed<Key>
>
class Cache
{};

I get this result:

@startuml
class Cache <template<typename Key, typename Value, typename CacheStrategy=CacheStrategy::LeastRecentlyUsed<Key>>> {
}
@enduml

This is rendered as:

template-signature

I would have expected something more formal UML, like here. I.e., I would expect something like:

@startuml
class Cache <Key, Value, CacheStrategy>{
}
@enduml

template-signature

I'm not sure what to do about the default value for template arguments.

mxmlnkn avatar Jul 06 '21 22:07 mxmlnkn

Unfortunately, the parser returns the template specification as a string. Since this package does not have the ambition to parse c++ code, this is unlikely to get fixed until the parser returns a shortened template specification or the parsing library is changed (for instance to libclang, which offers a displayname property matching your desired output).

I can't give an estimate of when that may happen, but I will keep this in mind, thanks.

thibaultmarin avatar Jul 26 '21 04:07 thibaultmarin