Babel  1
The voip software that only works on your local network
Loading...
Searching...
No Matches
OperatorRebind.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2024
3** rtype (Workspace)
4** File description:
5** OperatorRebind.hpp
6*/
7
13#pragma once
14#include <map>
15#include <set>
16#include <vector>
17#include <utility>
18#include <ostream>
19#include <unordered_set>
20#include <unordered_map>
21#include "Recoded/ToString.hpp"
22
23namespace Utilities
24{
36 inline std::ostream &operator<<(std::ostream &os, const bool &item)
37 {
38 os << Recoded::myToString(item);
39 return os;
40 };
41
56 template<typename T1, typename T2>
57 inline std::ostream &operator<<(std::ostream &os, const std::pair<T1, T2> &item)
58 {
59 os << Recoded::myToString(item);
60 return os;
61 };
62
76 template<typename T>
77 inline std::ostream &operator<<(std::ostream &os, const std::vector<T> &set)
78 {
79 os << Recoded::myToString(set);
80 return os;
81 }
82
96 template<typename Key, typename Value>
97 inline std::ostream &operator<<(std::ostream &os, const std::unordered_map<Key, Value> &map)
98 {
99 os << Recoded::myToString(map);
100 return os;
101 }
102
116 template<typename T>
117 inline std::ostream &operator<<(std::ostream &os, const std::set<T> &set)
118 {
119 os << Recoded::myToString(set);
120 return os;
121 }
122
136 template<typename T>
137 inline std::ostream &operator<<(std::ostream &os, const std::unordered_set<T> &set)
138 {
139 os << Recoded::myToString(set);
140 return os;
141 }
142}
143
154using Utilities::operator<<;
Provides custom string conversion functions as alternatives to std::to_string.
const std::string myToString(bool value)
Converts a boolean value to its string representation.
Definition ToString.cpp:22
std::ostream & operator<<(std::ostream &os, const bool &item)
Outputs a boolean value to the given output stream using a custom string representation.