CbmRoot
Loading...
Searching...
No Matches
StlUtils.h
Go to the documentation of this file.
1/* Copyright (C) 2024 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Felix Weiglhofer [committer] */
4
5#pragma once
6
13#include <algorithm>
14#include <string>
15#include <string_view>
16
17namespace cbm
18{
19
20 template<class C, class T>
21 bool Contains(const C& container, const T& value)
22 {
23 return std::find(container.begin(), container.end(), value) != container.end();
24 }
25
29 std::string Capitalize(std::string_view str);
30
31} // namespace cbm
bool Contains(const C &container, const T &value)
Definition StlUtils.h:21
std::string Capitalize(std::string_view str)
Capitalize the first letter of a string. The rest of the string is made lowercase.
Definition StlUtils.cxx:9