proxygen
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
Unit.h
Go to the documentation of this file.
1
/*
2
* Copyright 2015-present Facebook, Inc.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#pragma once
18
19
#include <type_traits>
20
21
namespace
folly
{
22
36
struct
Unit
{
37
constexpr
bool
operator==
(
const
Unit
&
/*other*/
)
const
{
38
return
true
;
39
}
40
constexpr
bool
operator!=
(
const
Unit
&
/*other*/
)
const
{
41
return
false
;
42
}
43
};
44
45
constexpr
Unit
unit
{};
46
47
template
<
typename
T>
48
struct
lift_unit
{
49
using
type
=
T
;
50
};
51
template
<>
52
struct
lift_unit
<void> {
53
using
type
=
Unit
;
54
};
55
template
<
typename
T>
56
using
lift_unit_t
=
typename
lift_unit<T>::type
;
57
58
template
<
typename
T>
59
struct
drop_unit
{
60
using
type
=
T
;
61
};
62
template
<>
63
struct
drop_unit
<
Unit
> {
64
using
type
= void;
65
};
66
template
<
typename
T>
67
using
drop_unit_t
=
typename
drop_unit<T>::type
;
68
69
}
// namespace folly
folly::Unit::operator==
constexpr bool operator==(const Unit &) const
Definition:
Unit.h:37
folly::drop_unit::type
T type
Definition:
Unit.h:60
folly::Unit::operator!=
constexpr bool operator!=(const Unit &) const
Definition:
Unit.h:40
folly::drop_unit< Unit >::type
void type
Definition:
Unit.h:64
folly::T
folly::std T
folly::drop_unit_t
typename drop_unit< T >::type drop_unit_t
Definition:
Unit.h:67
folly
—— Concurrent Priority Queue Implementation ——
Definition:
AtomicBitSet.h:29
folly::lift_unit
Definition:
Unit.h:48
folly::Unit
Definition:
Unit.h:36
folly::lift_unit_t
typename lift_unit< T >::type lift_unit_t
Definition:
Unit.h:56
folly::lift_unit::type
T type
Definition:
Unit.h:49
folly::unit
constexpr Unit unit
Definition:
Unit.h:45
folly::drop_unit
Definition:
Unit.h:59
proxygen
folly
folly
Unit.h
Generated by
1.8.11