je suis bete

This commit is contained in:
Kbz-8
2024-01-23 17:37:06 +01:00
parent 839666bbbd
commit a6ace6bd15
3 changed files with 15 additions and 6 deletions

View File

@@ -6,7 +6,7 @@
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/21 10:34:25 by maldavid #+# #+# */
/* Updated: 2024/01/23 16:48:15 by vvaas ### ########.fr */
/* Updated: 2024/01/23 17:35:49 by maldavid ### ########.fr */
/* */
/******************************************************************************/
@@ -17,8 +17,17 @@
#include <set>
#include <unstd/shared_ptr.hpp>
#include <client.hpp>
namespace irc
{
struct ClientCmp
{
bool operator()(const unstd::SharedPtr<Client>& lhs, const unstd::SharedPtr<Client>& rhs) const
{
return lhs.get() < rhs.get();
}
};
class Channel
{
public:
@@ -44,8 +53,8 @@ namespace irc
~Channel();
private:
std::set<unstd::SharedPtr<Client> > _clients;
std::set<unstd::SharedPtr<Client> > _operators;
std::set<unstd::SharedPtr<Client>, ClientCmp> _clients;
std::set<unstd::SharedPtr<Client>, ClientCmp> _operators;
const std::string _name;
std::string _password;
std::string _topic;

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/20 10:09:02 by maldavid #+# #+# */
/* Updated: 2024/01/21 12:27:07 by maldavid ### ########.fr */
/* Updated: 2024/01/23 17:35:24 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -34,7 +34,7 @@ namespace unstd
bool operator==(T* ptr);
T& operator*();
T* operator->();
T* get();
T* get() const;
void swap(SharedPtr& rhs);
void reset(T* ptr = NULL);
~SharedPtr();

View File

@@ -69,7 +69,7 @@ namespace unstd
}
template <typename T>
T* SharedPtr<T>::get()
T* SharedPtr<T>::get() const
{
return _ptr;
}