This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Blog of the original author: https://davidgorski.ca/posts/truncate-string-whitespace-compiletime-cpp/ | |
* Original source gist: https://gist.github.com/dgski/810ede7c4a80917c0adc99c6852fee9a | |
* | |
* Modifications by @t2ym (https://github.com/t2ym) | |
* - Rearranged as a header file | |
* - Surrounded main() by #ifdef COMPILE_TIME_TRUNCATION_EXAMPLE ... #endif | |
* - Added an argument "" to static_assert() to comply with C++11 | |
* - Put truncateWhitespace() in the compiletime namespace | |
* - Made is_whitespace() inline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2021, Tetsuya Mori <t2y3141592@gmail.com> | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions are met: | |
* | |
* 1. Redistributions of source code must retain the above copyright notice, | |
* this list of conditions and the following disclaimer. | |
* 2. Redistributions in binary form must reproduce the above copyright notice, |
OlderNewer