diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-12-14 15:30:28 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-12-14 15:30:28 +0100 |
| commit | 1de596dd9242b677d6b47b51db98ce98feb95465 (patch) | |
| tree | acbc79883c0af843b8b999a39f96cefd48e6e390 /cpp07/ex00/whatever.cpp | |
| parent | b13cd117a7957f9d86ec2986b47349979325a854 (diff) | |
| download | piscine_cpp-1de596dd9242b677d6b47b51db98ce98feb95465.tar.gz piscine_cpp-1de596dd9242b677d6b47b51db98ce98feb95465.tar.bz2 piscine_cpp-1de596dd9242b677d6b47b51db98ce98feb95465.zip | |
Updated cpp07 files with new subject
Diffstat (limited to 'cpp07/ex00/whatever.cpp')
| -rw-r--r-- | cpp07/ex00/whatever.cpp | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/cpp07/ex00/whatever.cpp b/cpp07/ex00/whatever.cpp deleted file mode 100644 index ebebf8c..0000000 --- a/cpp07/ex00/whatever.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* whatever.cpp :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/04/14 19:46:56 by charles #+# #+# */ -/* Updated: 2020/04/14 20:01:41 by charles ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include <iostream> -#include <string> - -template<typename T> -void swap(T& a, T& b) -{ - T tmp = a; - a = b; - b = tmp; -} - -template<typename T> -T& min(T& a, T& b) -{ - return a < b ? a : b; -} - -template<typename T> -T& max(T& a, T& b) -{ - return a > b ? a : b; -} - -int main() -{ - int a = 2; - int b = 3; - - ::swap(a, b); - std::cout << "a = " << a << ", b = " << b << std::endl; - std::cout << "min( a, b ) = " << ::min( a, b ) << std::endl; - std::cout << "max( a, b ) = " << ::max( a, b ) << std::endl; - - std::string c = "chaine1"; - std::string d = "chaine2"; - - ::swap(c, d); - std::cout << "c = " << c << ", d = " << d << std::endl; - std::cout << "min( c, d ) = " << ::min( c, d ) << std::endl; - std::cout << "max( c, d ) = " << ::max( c, d ) << std::endl; - - return 0; -} |
