Currently, the Slice compiler has a large API surface just for checking "does this type contain any X"?
Most crazily, we have a separate function for each type we'd want to check: hasClassDefs, hasOperations, hasStructs, ...
We also have a general purpose hasContained, which already makes those above functions redundant.
But this PR goes a step further. It deletes all the machinery, types, and functions for checking this,
and replaces them with a single template function: Container::contains<T>().
Currently, the Slice compiler has a large API surface just for checking "does this type contain any X"? Most crazily, we have a separate function for each type we'd want to check:
hasClassDefs
,hasOperations
,hasStructs
, ... We also have a general purposehasContained
, which already makes those above functions redundant.But this PR goes a step further. It deletes all the machinery, types, and functions for checking this, and replaces them with a single template function:
Container::contains<T>()
.Question for @bernardnormier, I came across this comment: https://github.com/zeroc-ice/ice/blob/71e30b88a5289221fda395b3185494c2aa6d2b6d/cpp/src/slice2cpp/Gen.cpp#L1998-L2002 What's the concern that it's talking about? It's not entirely clear to me.