.gitignore: add some more IDE / tools related file
[babeltrace.git] / src / cpp-common / bt2c / contains.hpp
CommitLineData
237a48ad
PP
1/*
2 * Copyright (c) 2024 Philippe Proulx <pproulx@efficios.com>
3 *
4 * SPDX-License-Identifier: MIT
5 */
6
7#ifndef BABELTRACE_CPP_COMMON_BT2C_CONTAINS_HPP
8#define BABELTRACE_CPP_COMMON_BT2C_CONTAINS_HPP
9
10namespace bt2c {
11
12/*
13 * Returns whether or not the STL container `container` contains the
14 * value `val`.
15 */
16template <typename T, typename V>
17bool contains(const T& container, const V& val) noexcept
18{
19 return container.find(val) != container.end();
20}
21
22} /* namespace bt2c */
23
24#endif /* BABELTRACE_CPP_COMMON_BT2C_CONTAINS_HPP */
This page took 0.026193 seconds and 4 git commands to generate.