Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
std::flat_map::keys(3)	      C++ Standard Libary	std::flat_map::keys(3)

NAME
       std::flat_map::keys - std::flat_map::keys

Synopsis
	  const	key_container_type& keys() const noexcept;  (since C++23)

	  Return  a  constant reference	to the adapted keys container. Equiva-
       lent to return
	  c.keys;.

Parameters
	  (none)

Return value
	  The underlying keys container.

Complexity
	  Constant.

Example
       // Run this code

	#include <flat_map>
	#include <print>
	#include <type_traits>
	#include <vector>

	int main()
	{
	    std::flat_map<int, double> adaptor{{1, 1.1}, {2, 2.2}, {3, 3.3}};

	    // The default keys	container is std::vector:
	    static_assert(std::is_same_v<decltype(adaptor.keys()),	 const
       std::vector<int>&>);

	    std::println("{}", adaptor.keys());
	}

Output:
	[1, 2, 3]

See also
	  values direct	access to the underlying values	container
		 (public member	function)

http://cppreference.com		  2024.06.10		std::flat_map::keys(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=std::flat_map::keys&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help