mirror of https://github.com/PCSX2/pcsx2.git
utilities: Restrict pxWindowAndFlag templates to wxObject derived classes
Fixes a compile error (C2666) on VS2017 15.8 caused by ambiguity issues. The sstream header uses constexpr auto _both = ios_base::in | ios_base::out; Without the extra type restrictions the compiler cannot tell whether to use the template or the built-in | operator (the const wxSizerFlags & parameter will accept ints).
This commit is contained in:
parent
b84a2cfaf6
commit
890d7ab953
|
@ -199,14 +199,14 @@ struct pxWindowAndFlags
|
|||
|
||||
extern wxSizerFlags operator&(const wxSizerFlags &_flgs, const wxSizerFlags &_flgs2);
|
||||
|
||||
template <typename WinType>
|
||||
template <typename WinType, typename = typename std::enable_if<std::is_base_of<wxObject, WinType>::value>::type>
|
||||
pxWindowAndFlags<WinType> operator|(WinType *_win, const wxSizerFlags &_flgs)
|
||||
{
|
||||
pxWindowAndFlags<WinType> result = {_win, _flgs};
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename WinType>
|
||||
template <typename WinType, typename = typename std::enable_if<std::is_base_of<wxObject, WinType>::value>::type>
|
||||
pxWindowAndFlags<WinType> operator|(WinType &_win, const wxSizerFlags &_flgs)
|
||||
{
|
||||
pxWindowAndFlags<WinType> result = {&_win, _flgs};
|
||||
|
|
Loading…
Reference in New Issue