From 7a1d92e8fec883228efbc6ceb1896848e750fcdd Mon Sep 17 00:00:00 2001 From: "Nicholas \"LB\" Braden" Date: Mon, 18 Nov 2013 23:32:08 -0600 Subject: [PATCH 1/4] Create make_signed.hpp --- tmp-make_signed/make_signed.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tmp-make_signed/make_signed.hpp diff --git a/tmp-make_signed/make_signed.hpp b/tmp-make_signed/make_signed.hpp new file mode 100644 index 0000000..484780f --- /dev/null +++ b/tmp-make_signed/make_signed.hpp @@ -0,0 +1,17 @@ +#ifndef TemplateMetaprogramming_MakeSigned_HeaderPlusPlus +#define TemplateMetaprogramming_MakeSigned_HeaderPlusPlus + +#include +#include "identity.hpp" //see ../tmp-identity/ + +#include + +template +using make_signed = typename std::conditional +< + std::is_integral::value, + std::make_signed, + identity +>::type; + +#endif From 85261538b2265e7f5a0d1247b9605e100f147227 Mon Sep 17 00:00:00 2001 From: "Nicholas \"LB\" Braden" Date: Mon, 18 Nov 2013 23:32:09 -0600 Subject: [PATCH 2/4] Create README.md --- tmp-make_signed/README.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tmp-make_signed/README.md diff --git a/tmp-make_signed/README.md b/tmp-make_signed/README.md new file mode 100644 index 0000000..0c6b944 --- /dev/null +++ b/tmp-make_signed/README.md @@ -0,0 +1,7 @@ +This snippet depends on tmp-identity. + +Usage examples: +* http://stackoverflow.com/a/16377818/1959975 +* http://ideone.com/uNCPt5 + +See wiki for documentation. From f01d25df742a04154948f824c732cf995069ea97 Mon Sep 17 00:00:00 2001 From: "Nicholas \"LB\" Braden" Date: Mon, 18 Nov 2013 23:32:19 -0600 Subject: [PATCH 3/4] Create LICENSE --- tmp-make_signed/LICENSE | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tmp-make_signed/LICENSE diff --git a/tmp-make_signed/LICENSE b/tmp-make_signed/LICENSE new file mode 100644 index 0000000..cf1ab25 --- /dev/null +++ b/tmp-make_signed/LICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to From 4fea868273027f93be40742ff5e2eba90f8864a5 Mon Sep 17 00:00:00 2001 From: "Nicholas \"LB\" Braden" Date: Mon, 18 Nov 2013 23:36:52 -0600 Subject: [PATCH 4/4] Remove redundant include --- tmp-make_signed/make_signed.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/tmp-make_signed/make_signed.hpp b/tmp-make_signed/make_signed.hpp index 484780f..3d92f6f 100644 --- a/tmp-make_signed/make_signed.hpp +++ b/tmp-make_signed/make_signed.hpp @@ -4,8 +4,6 @@ #include #include "identity.hpp" //see ../tmp-identity/ -#include - template using make_signed = typename std::conditional <