Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
61d150c9
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
1 年多 前同步成功
通知
0
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
61d150c9
编写于
5月 10, 2019
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[meta] Add integral_constant, true_t -> true_type, false_t -> false_type
上级
38e3a8bd
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
21 deletion
+20
-21
src/hb-iter.hh
src/hb-iter.hh
+10
-10
src/hb-meta.hh
src/hb-meta.hh
+8
-9
src/hb-null.hh
src/hb-null.hh
+2
-2
未找到文件。
src/hb-iter.hh
浏览文件 @
61d150c9
...
...
@@ -243,8 +243,8 @@ template<typename Iter, typename Item>
struct
hb_is_iterator_of
{
template
<
typename
Item2
=
Item
>
static
hb_true_t
impl
(
hb_priority
<
2
>
,
hb_iter_t
<
Iter
,
hb_type_identity
<
Item2
>>
*
);
static
hb_false_t
impl
(
hb_priority
<
0
>
,
const
void
*
);
static
hb_true_t
ype
impl
(
hb_priority
<
2
>
,
hb_iter_t
<
Iter
,
hb_type_identity
<
Item2
>>
*
);
static
hb_false_t
ype
impl
(
hb_priority
<
0
>
,
const
void
*
);
public:
static
constexpr
bool
value
=
decltype
(
impl
(
hb_prioritize
,
hb_declval
(
Iter
*
)))
::
value
;
...
...
@@ -260,10 +260,10 @@ struct hb_is_iterable
private:
template
<
typename
U
>
static
auto
impl
(
hb_priority
<
1
>
)
->
decltype
(
hb_declval
(
U
).
iter
(),
hb_true_t
());
static
auto
impl
(
hb_priority
<
1
>
)
->
decltype
(
hb_declval
(
U
).
iter
(),
hb_true_t
ype
());
template
<
typename
>
static
hb_false_t
impl
(
hb_priority
<
0
>
);
static
hb_false_t
ype
impl
(
hb_priority
<
0
>
);
public:
static
constexpr
bool
value
=
decltype
(
impl
<
T
>
(
hb_prioritize
))
::
value
;
...
...
@@ -278,10 +278,10 @@ struct hb_is_source_of
private:
template
<
typename
Iter2
=
Iter
,
hb_enable_if
(
hb_is_convertible
(
typename
Iter2
::
item_t
,
const
Item
&
))>
static
hb_true_t
impl
(
hb_priority
<
2
>
);
static
hb_true_t
ype
impl
(
hb_priority
<
2
>
);
template
<
typename
Iter2
=
Iter
>
static
auto
impl
(
hb_priority
<
1
>
)
->
decltype
(
hb_declval
(
Iter2
)
>>
hb_declval
(
Item
&
),
hb_true_t
());
static
hb_false_t
impl
(
hb_priority
<
0
>
);
static
auto
impl
(
hb_priority
<
1
>
)
->
decltype
(
hb_declval
(
Iter2
)
>>
hb_declval
(
Item
&
),
hb_true_t
ype
());
static
hb_false_t
ype
impl
(
hb_priority
<
0
>
);
public:
static
constexpr
bool
value
=
decltype
(
impl
(
hb_prioritize
))
::
value
;
...
...
@@ -294,10 +294,10 @@ struct hb_is_sink_of
private:
template
<
typename
Iter2
=
Iter
,
hb_enable_if
(
hb_is_convertible
(
typename
Iter2
::
item_t
,
Item
&
))>
static
hb_true_t
impl
(
hb_priority
<
2
>
);
static
hb_true_t
ype
impl
(
hb_priority
<
2
>
);
template
<
typename
Iter2
=
Iter
>
static
auto
impl
(
hb_priority
<
1
>
)
->
decltype
(
hb_declval
(
Iter2
)
<<
hb_declval
(
Item
),
hb_true_t
());
static
hb_false_t
impl
(
hb_priority
<
0
>
);
static
auto
impl
(
hb_priority
<
1
>
)
->
decltype
(
hb_declval
(
Iter2
)
<<
hb_declval
(
Item
),
hb_true_t
ype
());
static
hb_false_t
ype
impl
(
hb_priority
<
0
>
);
public:
static
constexpr
bool
value
=
decltype
(
impl
(
hb_prioritize
))
::
value
;
...
...
src/hb-meta.hh
浏览文件 @
61d150c9
...
...
@@ -45,11 +45,10 @@ template<typename... Ts> using hb_void_tt = typename _hb_void_tt<Ts...>::type;
template
<
typename
Head
,
typename
...
Ts
>
struct
_hb_head_tt
{
typedef
Head
type
;
};
template
<
typename
...
Ts
>
using
hb_head_tt
=
typename
_hb_head_tt
<
Ts
...
>::
type
;
/* Bool! For when we need to evaluate type-dependent expressions
* in a template argument. */
template
<
bool
b
>
struct
hb_bool_constant
{
static
constexpr
bool
value
=
b
;
};
typedef
hb_bool_constant
<
true
>
hb_true_t
;
typedef
hb_bool_constant
<
false
>
hb_false_t
;
template
<
typename
T
,
T
v
>
struct
hb_integral_constant
{
static
constexpr
T
value
=
v
;
};
template
<
bool
b
>
using
hb_bool_constant
=
hb_integral_constant
<
bool
,
b
>
;
using
hb_true_type
=
hb_bool_constant
<
true
>
;
using
hb_false_type
=
hb_bool_constant
<
false
>
;
/* Basic type SFINAE. */
...
...
@@ -60,8 +59,8 @@ template <typename T> struct hb_enable_if<true, T> { typedef T ty
/* Concepts/Requires alias: */
#define hb_requires(Cond) hb_enable_if((Cond))
template
<
typename
T
,
typename
T2
>
struct
hb_is_same
:
hb_false_t
{};
template
<
typename
T
>
struct
hb_is_same
<
T
,
T
>
:
hb_true_t
{};
template
<
typename
T
,
typename
T2
>
struct
hb_is_same
:
hb_false_t
ype
{};
template
<
typename
T
>
struct
hb_is_same
<
T
,
T
>
:
hb_true_t
ype
{};
#define hb_is_same(T, T2) hb_is_same<T, T2>::value
/* Function overloading SFINAE and priority. */
...
...
@@ -145,12 +144,12 @@ struct hb_is_convertible
static
constexpr
bool
either_void
=
from_void
||
to_void
;
static
constexpr
bool
both_void
=
from_void
&&
to_void
;
static
hb_true_t
impl2
(
hb_conditional
<
to_void
,
int
,
To
>
);
static
hb_true_t
ype
impl2
(
hb_conditional
<
to_void
,
int
,
To
>
);
template
<
typename
T
>
static
auto
impl
(
hb_priority
<
1
>
)
->
decltype
(
impl2
(
hb_declval
(
T
)));
template
<
typename
T
>
static
hb_false_t
impl
(
hb_priority
<
0
>
);
static
hb_false_t
ype
impl
(
hb_priority
<
0
>
);
public:
static
constexpr
bool
value
=
both_void
||
(
!
either_void
&&
...
...
src/hb-null.hh
浏览文件 @
61d150c9
...
...
@@ -55,7 +55,7 @@ struct _hb_null_size<T, hb_bool_constant<true || sizeof (T::min_size)>>
template
<
typename
T
>
struct
hb_null_size
{
enum
{
value
=
_hb_null_size
<
T
,
hb_true_t
>::
value
};
};
{
enum
{
value
=
_hb_null_size
<
T
,
hb_true_t
ype
>::
value
};
};
#define hb_null_size(T) hb_null_size<T>::value
/* These doesn't belong here, but since is copy/paste from above, put it here. */
...
...
@@ -72,7 +72,7 @@ struct _hb_static_size<T, hb_bool_constant<true || sizeof (T::min_size)>>
template
<
typename
T
>
struct
hb_static_size
{
enum
{
value
=
_hb_static_size
<
T
,
hb_true_t
>::
value
};
};
{
enum
{
value
=
_hb_static_size
<
T
,
hb_true_t
ype
>::
value
};
};
#define hb_static_size(T) hb_static_size<T>::value
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录