compare_type

sphinx_doxysummary.utils.compare_type(arg1: str, arg2: str) bool

Check if type of 2 arguments are the same.

Parameters:
  • arg1 (str) – First argument.

  • arg2 (str) – Second argument.

Returns:

True if 2 arguments have the same type.

Return type:

bool

Examples

>>> compare_type('const int a', 'int const')  # normal case
True
>>> compare_type('const int * a', 'int *')  # without specifier
False
>>> compare_type('const int &', 'int const &')  # change specifier position
True
>>> compare_type('std::vector<const double *> &', 'std::vector<double const> &')  # template
False
>>> compare_type('void', '')
True