Skip to content

Commit

Permalink
Add comment explaining "option.template get_value<int>()".
Browse files Browse the repository at this point in the history
  • Loading branch information
jralls committed Jun 17, 2023
1 parent 4dc8a7e commit aae568e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libgnucash/engine/gnc-optiondb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,14 @@ option_path(const GncOption& option, GSList* list)
list->data = (void*)option.get_section().c_str();
}

/* The usage "option.template get_value<bool>()" looks weird, but it's required
* by the C++ standard: "When the name of a member template specialization
* appears after . or -> in a postfix-expression, or after nested-name-specifier
* in a qualified-id, and the postfix-expression or qualified-id explicitly
* depends on a template-parameter (14.6.2), the member template name must be
* prefixed by the keyword template. Otherwise the name is assumed to name a
* non-template."
*/
static inline KvpValue*
kvp_value_from_bool_option(const GncOption& option)
{
Expand Down

0 comments on commit aae568e

Please sign in to comment.