added const postfix at Size2<>
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include<hgl/type/DataType.h>
|
||||
|
||||
namespace hgl
|
||||
{
|
||||
/**
|
||||
* <EFBFBD>ߴ<EFBFBD>ģ<EFBFBD><EFBFBD>
|
||||
* 尺寸模板
|
||||
*/
|
||||
template<typename T> struct Size2
|
||||
{
|
||||
@@ -24,8 +24,8 @@ namespace hgl
|
||||
height=h;
|
||||
}
|
||||
|
||||
const bool isLandscape()const{return width>height;} ///<<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
const bool isPortrait()const{return width<height;} ///<<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
const bool isLandscape()const{return width>height;} ///<是否横的
|
||||
const bool isPortrait()const{return width<height;} ///<是否竖的
|
||||
|
||||
void Swap()
|
||||
{
|
||||
@@ -34,7 +34,19 @@ namespace hgl
|
||||
height=t;
|
||||
}
|
||||
|
||||
Size2<T> Swapped(){return Size2<T>(height,width);} ///<<3C><>ȡһ<C8A1><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ijߴ<C4B3>
|
||||
Size2<T> Swapped()const{return Size2<T>(height,width);} ///<获取一个横竖交换的尺寸
|
||||
|
||||
const bool operator == (const Size2<T> &s) const
|
||||
{
|
||||
if(width!=s.width)return(false);
|
||||
if(height!=s.height)return(false);
|
||||
return(true);
|
||||
}
|
||||
|
||||
const bool operator != (const Size2<T> &s) const
|
||||
{
|
||||
return !operator==(s);
|
||||
}
|
||||
};//template<typename T> struct Size2
|
||||
|
||||
using Size2i =Size2<int>;
|
||||
|
Reference in New Issue
Block a user