#ifndef T_CC_H #define T_CC_H #pragma once #include #include #include #include "iostream" #include "mutex" #define CCVar auto using String = std::string; typedef std::exception CCException; typedef std::unique_lock CCUniqueLock; namespace CC { inline String to_String(int v){ return std::to_string(v); } inline String to_String(double v){ return std::to_string(v); } inline String to_String(bool v){ return v ? "true" : "false"; } inline String to_String(const char* v){ return v; } inline String to_String(String v){ return v; } inline String to_String(void* v){ return std::to_string((size_t)v); } template inline void Print(const T& v){ std::cout << v; } template inline void Print(const T& v,Args&&... args){ std::cout << v; Print(args...); } template inline void Println(const T& v){ std::cout<< v << std::endl; } inline void ErrorPrintln(const String& v){ throw std::out_of_range(v.c_str()); } inline int LogoTimeMS = 110; inline void CC_Print_Logo(){ std::cout << " CCCCCCCCCCCCC CCCCCCCCCCCCC AAA PPPPPPPPPPPPPPPPP IIIIIIIIII " << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(LogoTimeMS)); std::cout << " CCC::::::::::::C CCC::::::::::::C A:::A P::::::::::::::::P I::::::::I" << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(LogoTimeMS)); std::cout << " CC:::::::::::::::C CC:::::::::::::::C A:::::A P::::::PPPPPP:::::P I::::::::I" << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(LogoTimeMS)); std::cout << " C:::::CCCCCCCC::::C C:::::CCCCCCCC::::C A:::::::A PP:::::P P:::::PII::::::II" << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(LogoTimeMS)); std::cout << " C:::::C CCCCCC C:::::C CCCCCC A:::::::::A P::::P P:::::P I::::I " << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(LogoTimeMS)); std::cout << "C:::::C C:::::C A:::::A:::::A P::::P P:::::P I::::I " << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(LogoTimeMS)); std::cout << "C:::::C C:::::C A:::::A A:::::A P::::PPPPPP:::::P I::::I " << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(LogoTimeMS)); std::cout << "C:::::C C:::::C A:::::A A:::::A P:::::::::::::PP I::::I " << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(LogoTimeMS)); std::cout << "C:::::C C:::::C A:::::A A:::::A P::::PPPPPPPPP I::::I " << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(LogoTimeMS)); std::cout << "C:::::C C:::::C A:::::AAAAAAAAA:::::A P::::P I::::I " << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(LogoTimeMS)); std::cout << "C:::::C C:::::C A:::::::::::::::::::::A P::::P I::::I " << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(LogoTimeMS)); std::cout << " C:::::C CCCCCC C:::::C CCCCCC A:::::AAAAAAAAAAAAA:::::A P::::P I::::I " << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(LogoTimeMS)); std::cout << " C:::::CCCCCCCC::::C C:::::CCCCCCCC::::C A:::::A A:::::A PP::::::PP II::::::II" << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(LogoTimeMS)); std::cout << " CC:::::::::::::::C CC:::::::::::::::C A:::::A A:::::A P::::::::P I::::::::I" << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(LogoTimeMS)); std::cout << " CCC::::::::::::C CCC::::::::::::C A:::::A A:::::A P::::::::P I::::::::I" << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(LogoTimeMS)); std::cout << " CCCCCCCCCCCCC CCCCCCCCCCCCC AAAAAAA AAAAAAAPPPPPPPPPP IIIIIIIIII" << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(LogoTimeMS)); std::cout << " ________________________ "<< std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(LogoTimeMS)); std::cout << " _:::::::::::::::::::::_ " << std::endl; std::cout << " ________________________ "<< std::endl; std::cout << " " << std::endl; } } class CCInt { private: int value; public: CCInt() = default; CCInt(int v){ this->value = v; } String to_String() const{ return std::to_string(value); } }; class CCDouble { private: double value; public: CCDouble() = default; CCDouble(double v){ this->value = v; } String to_String(int x = 5) const{ std::ostringstream stream; stream << std::fixed << std::setprecision(x) << value; return stream.str(); } }; class CCFloat { private: float value; public: CCFloat() = default; CCFloat(float v){ this->value = v; } String to_String(int x = 5) const{ std::ostringstream stream; stream << std::fixed << std::setprecision(x) << value; return stream.str(); } }; #endif