mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
possible solution to #567
This commit is contained in:
parent
d10ebc6555
commit
8cb8dfeed6
@ -25,5 +25,6 @@
|
|||||||
#include <gsl/span> // span
|
#include <gsl/span> // span
|
||||||
#include <gsl/string_span> // zstring, string_span, zstring_builder...
|
#include <gsl/string_span> // zstring, string_span, zstring_builder...
|
||||||
#include <gsl/pointers> // owner, not_null
|
#include <gsl/pointers> // owner, not_null
|
||||||
|
#include <gsl/pointers_ios>// ostream operator for not_null
|
||||||
|
|
||||||
#endif // GSL_GSL_H
|
#endif // GSL_GSL_H
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
#include <gsl/gsl_assert>
|
#include <gsl/gsl_assert>
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
@ -112,13 +111,6 @@ private:
|
|||||||
T ptr_;
|
T ptr_;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T>
|
|
||||||
std::ostream& operator<<(std::ostream& os, const not_null<T>& val)
|
|
||||||
{
|
|
||||||
os << val.get();
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class U>
|
template <class T, class U>
|
||||||
auto operator==(const not_null<T>& lhs, const not_null<U>& rhs) -> decltype(lhs.get() == rhs.get())
|
auto operator==(const not_null<T>& lhs, const not_null<U>& rhs) -> decltype(lhs.get() == rhs.get())
|
||||||
{
|
{
|
||||||
|
36
include/gsl/pointers_ios
Normal file
36
include/gsl/pointers_ios
Normal file
@ -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 <iostream>
|
||||||
|
#include <gsl/pointers>
|
||||||
|
|
||||||
|
namespace gsl
|
||||||
|
{
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
std::ostream& operator<<(std::ostream& os, const not_null<T>& val)
|
||||||
|
{
|
||||||
|
os << val.get();
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
Loading…
Reference in New Issue
Block a user