/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* main.cpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: bchanot +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2026/01/05 12:47:49 by bchanot #+# #+# */ /* Updated: 2026/01/05 14:52:57 by bchanot ### ########.fr */ /* */ /* ************************************************************************** */ #include "Serializer.hpp" int main(void) { Data ori; ori.data = 3940; uintptr_t i = Serializer::serialize(&ori); if (ori.data == i ) { std::cout << "original uintptr_t from Data == return value of serialize function." << std::endl; } std::cout << "original : " << ori.data << "; Returned : " << i << std::endl; Data *test = Serializer::deserialize(i); if (test->data == i ) { std::cout << "original uintptr_t from serialize == Data of return value of deserialize function." << std::endl; } std::cout << "original : " << i << "; returned : " << test->data << std::endl; if (ori.data == test->data) std::cout << "both Data struct pointeur are ==" << std::endl; return 0; }