We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
deque
1 parent aee65d7 commit c4bc996Copy full SHA for c4bc996
source/cppfront.cpp
@@ -870,21 +870,12 @@ class cppfront
870
};
871
class current_functions_
872
{
873
- std::vector<function_info> list = { {} };
874
- const size_t MaxNestedFunctions = 100; // see the next comment and the assertion:
+ std::deque<function_info> list = { {} };
875
public:
876
- current_functions_() {
877
- list.reserve(MaxNestedFunctions); // (1) for pointer stability / lifetime safety
878
- }
879
-
880
auto push(
881
declaration_node const* decl,
882
declaration_node::declared_that_funcs thats
883
) {
884
- assert(
885
- list.size() < MaxNestedFunctions // (2) check that we're not exceeding the limit
886
- && "ICE: overflowed limit on nested functions - fix by increasing MaxNestedFunctions value"
887
- );
888
list.emplace_back(decl, thats);
889
}
890
0 commit comments