diff --git a/include/gsl/gsl b/include/gsl/gsl index 4f69bbf..57df82f 100644 --- a/include/gsl/gsl +++ b/include/gsl/gsl @@ -25,5 +25,6 @@ #include // span #include // zstring, string_span, zstring_builder... #include // owner, not_null +#include // ostream operator for not_null #endif // GSL_GSL_H diff --git a/include/gsl/pointers b/include/gsl/pointers index 83ac9ea..5c601f7 100644 --- a/include/gsl/pointers +++ b/include/gsl/pointers @@ -21,7 +21,6 @@ #include -#include #include #include @@ -112,13 +111,6 @@ private: T ptr_; }; -template -std::ostream& operator<<(std::ostream& os, const not_null& val) -{ - os << val.get(); - return os; -} - template auto operator==(const not_null& lhs, const not_null& rhs) -> decltype(lhs.get() == rhs.get()) { diff --git a/include/gsl/pointers_ios b/include/gsl/pointers_ios new file mode 100644 index 0000000..e612eb0 --- /dev/null +++ b/include/gsl/pointers_ios @@ -0,0 +1,36 @@ +/////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) 2015 Microsoft Corporation. All rights reserved. +// +// This code is licensed under the MIT License (MIT). +// +// 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 OR COPYRIGHT HOLDERS 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. +// +/////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#ifndef GSL_POINTERS_IOS_H +#define GSL_POINTERS_IOS_H + +#include +#include + +namespace gsl +{ + +template +std::ostream& operator<<(std::ostream& os, const not_null& val) +{ + os << val.get(); + return os; +} + +} +#endif \ No newline at end of file