Namespaces
Variants
Views
Actions

Difference between revisions of "Template:cpp/container/if c++98"

From cppreference.com
(Remember C++98.)
 
m (Added C++98's container adaptors too. Now this template is used only in {{dsc begin/end}}, so it is OK)
 
Line 1: Line 1:
 
{{#switch:{{{1|}}}
 
{{#switch:{{{1|}}}
|vector|list|deque|set|multiset|map|multimap={{{2|}}}
+
|vector|list|deque|set|multiset|map|multimap|stack|queue|priority_queue={{{2|}}}
 
|{{{3|}}}
 
|{{{3|}}}
 
}}<noinclude>
 
}}<noinclude>
 
{{documentation|Template:cpp/container/if assoc/doc}}
 
{{documentation|Template:cpp/container/if assoc/doc}}
 
</noinclude>
 
</noinclude>

Latest revision as of 10:31, 21 December 2023

[edit] [{{purge}}] Template documentation

This is one of the group of the templates used to categorize containers.

The general form is:

{{cpp/container/TERM|container|if-true|if-false (optional)}}:

  • results in if-true if container is one in given container/adaptor group.
  • results in if-false (if present), otherwise.
TERM Containers/adaptors in the group
if seq
  • array, inplace_vector, vector, deque, list, forward_list
if assoc
  • set, multiset, map, multimap
  • unordered_set, unordered_multiset, unordered_map, unordered_multimap
  • flat_set, flat_multiset, flat_map, flat_multimap
if ord
  • set, multiset, map, multimap
  • flat_set, flat_multiset, flat_map, flat_multimap
if unord
  • unordered_set, unordered_multiset, unordered_map, unordered_multimap
if uniq
  • set, map
  • unordered_set, unordered_map
  • flat_set, flat_map
if eq
  • multiset, multimap
  • unordered_multiset, unordered_multimap
  • flat_multiset, flat_multimap
if set
  • set, multiset
  • unordered_set, unordered_multiset
  • flat_set, flat_multiset
if map
  • map, multimap
  • unordered_map, unordered_multimap
  • flat_map, flat_multimap
if ad
  • stack, queue, priority_queue
  • flat_set, flat_multiset, flat_map, flat_multimap
if flat
  • flat_set, flat_multiset, flat_map, flat_multimap
if c++98
  • vector, list, set, multiset, map, multimap
  • stack, queue, priority_queue
if c++11
  • array, forward_list
  • unordered_set, unordered_multiset, unordered_map, unordered_multimap
  • span
  • flat_set, flat_multiset, flat_map, flat_multimap
  • inplace_vector

[edit] Examples

{{cpp/container/if set|multiset|Yes|No}} results in Yes.

{{cpp/container/if seq|multiset|Yes|No}} results in No.