🗑️」 clean: moved to other file

This commit is contained in:
2025-04-08 16:20:23 +02:00
parent b30e6652e4
commit 2b51c0baca
3 changed files with 53 additions and 11 deletions

28
ex00/PrintNb.hpp Normal file
View File

@ -0,0 +1,28 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* PrintNb.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/04/08 14:30:07 by adjoly #+# #+# */
/* Updated: 2025/04/08 14:30:36 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#include <iostream>
template <typename T> void _printFloat(T nb) {
std::cout << "float: " << static_cast<float>(nb) << "f" << std::endl;
}
template <typename T> void _printInt(T nb) {
std::cout << "int: " << static_cast<int>(nb) << std::endl;
}
template <typename T> void _printChar(T nb) {
std::cout << "char: '" << static_cast<char>(nb) << "'" << std::endl;
}
template <typename T> void _printDouble(T nb) {
std::cout << "double: " << static_cast<double>(nb) << std::endl;
}

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */ /* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2025/04/03 19:59:17 by adjoly #+# #+# */ /* Created: 2025/04/03 19:59:17 by adjoly #+# #+# */
/* Updated: 2025/04/04 11:20:32 by adjoly ### ########.fr */ /* Updated: 2025/04/08 14:17:44 by adjoly ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -25,7 +25,6 @@ void _log(std::string emoji, std::string what, std::string who,
#endif #endif
} }
ScalarConverter::ScalarConverter(void) { ScalarConverter::ScalarConverter(void) {
_log("", "ScalarConverter", "", "default constructor called"); _log("", "ScalarConverter", "", "default constructor called");
} }
@ -39,9 +38,10 @@ ScalarConverter::ScalarConverter(const ScalarConverter &cpy) {
ScalarConverter::~ScalarConverter(void) { ScalarConverter::~ScalarConverter(void) {
_log("", "ScalarConverter", "", "destructor called"); _log("", "ScalarConverter", "", "destructor called");
} }
ScalarConverter &ScalarConverter::operator=(const ScalarConverter &) { return *this; }
void ScalarConverter::convert(std::string &s) { void ScalarConverter::convert(std::string &s) {
} }

View File

@ -6,22 +6,36 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */ /* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2025/04/03 19:38:39 by adjoly #+# #+# */ /* Created: 2025/04/03 19:38:39 by adjoly #+# #+# */
/* Updated: 2025/04/04 12:12:41 by adjoly ### ########.fr */ /* Updated: 2025/04/08 14:29:28 by adjoly ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#pragma once #pragma once
#include <string>
#include <iostream> #include <iostream>
#include <string>
class ScalarConverter { class ScalarConverter {
public: public:
static void convert(std::string &); static void convert(std::string &);
private: private:
ScalarConverter(void); ScalarConverter(void);
ScalarConverter(const ScalarConverter &); ScalarConverter(const ScalarConverter &);
~ScalarConverter(void); ~ScalarConverter(void);
ScalarConverter &operator=(const ScalarConverter &); ScalarConverter &operator=(const ScalarConverter &);
template <typename T> void _printFloat(T nb) {
std::cout << "float: " << static_cast<float>(nb) << "f" << std::endl;
}
template <typename T> void _printInt(T nb) {
std::cout << "int: " << static_cast<int>(nb) << std::endl;
}
template <typename T> void _printChar(T nb) {
std::cout << "char: '" << static_cast<char>(nb) << "'" << std::endl;
}
template <typename T> void _printDouble(T nb) {
std::cout << "double: " << static_cast<double>(nb) << std::endl;
}
}; };