Discussion Overview
The discussion revolves around the use of member types in STL containers, particularly focusing on how to declare variables using these types. Participants explore the implications of using member types like key_type in the context of developing custom container templates, such as a trie, and the general-purpose nature of these types in library code.
Discussion Character
- Technical explanation
- Conceptual clarification
- Debate/contested
Main Points Raised
- Some participants suggest that member types like key_type are intended to make library code hardware-independent and general-purpose, rather than for direct use in most applications.
- Others argue that declaring a variable of type key_type is only necessary when creating custom container templates, where the key type is not known in advance.
- A participant mentions they are developing a trie that uses a map for storage, indicating a practical application of the discussion.
- One participant proposes defining a typedef for long type names to simplify code, suggesting this as a solution to avoid repetitive typing of complex types.
- A later reply shares a complete implementation of a trie class, demonstrating the application of the discussed concepts in a practical context.
Areas of Agreement / Disagreement
Participants express differing views on the necessity and utility of member types in practical applications. While some agree on their general-purpose nature, others highlight specific scenarios where they are beneficial, indicating that the discussion remains unresolved regarding their overall utility.
Contextual Notes
Limitations include the potential misunderstanding of when to use member types and the implications of changing underlying container types, which are not fully explored in the discussion.