Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Root
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
为了安全,强烈建议开启2FA双因子认证:User Settings -> Account -> Enable two-factor authentication!!!
Show more breadcrumbs
cxwx
Root
Commits
fcf198dc
Commit
fcf198dc
authored
6 years ago
by
Vassil Vassilev
Browse files
Options
Downloads
Patches
Plain Diff
[cling] Standalone function definitions in headers must be marked inline.
parent
ff8abdf5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
interpreter/cling/include/cling/Interpreter/RuntimePrintValue.h
+15
-15
15 additions, 15 deletions
...reter/cling/include/cling/Interpreter/RuntimePrintValue.h
with
15 additions
and
15 deletions
interpreter/cling/include/cling/Interpreter/RuntimePrintValue.h
+
15
−
15
View file @
fcf198dc
...
@@ -28,7 +28,7 @@ namespace cling {
...
@@ -28,7 +28,7 @@ namespace cling {
// Fallback for e.g. vector<bool>'s bit iterator:
// Fallback for e.g. vector<bool>'s bit iterator:
template
<
class
T
,
template
<
class
T
,
class
=
typename
std
::
enable_if
<!
std
::
is_pointer
<
T
>
::
value
>::
type
>
class
=
typename
std
::
enable_if
<!
std
::
is_pointer
<
T
>
::
value
>::
type
>
std
::
string
printValue
(
const
T
&
val
)
{
return
"{not representable}"
;
}
inline
std
::
string
printValue
(
const
T
&
val
)
{
return
"{not representable}"
;
}
// void pointer
// void pointer
std
::
string
printValue
(
const
void
**
ptr
);
std
::
string
printValue
(
const
void
**
ptr
);
...
@@ -92,22 +92,22 @@ namespace cling {
...
@@ -92,22 +92,22 @@ namespace cling {
std
::
string
toUTF8
(
const
T
*
const
Src
,
size_t
N
,
const
char
Prefix
=
0
);
std
::
string
toUTF8
(
const
T
*
const
Src
,
size_t
N
,
const
char
Prefix
=
0
);
template
<
size_t
N
>
template
<
size_t
N
>
std
::
string
printValue
(
char16_t
const
(
*
val
)[
N
])
{
inline
std
::
string
printValue
(
char16_t
const
(
*
val
)[
N
])
{
return
toUTF8
(
reinterpret_cast
<
const
char16_t
*
const
>
(
val
),
N
,
'u'
);
return
toUTF8
(
reinterpret_cast
<
const
char16_t
*
const
>
(
val
),
N
,
'u'
);
}
}
template
<
size_t
N
>
template
<
size_t
N
>
std
::
string
printValue
(
char32_t
const
(
*
val
)[
N
])
{
inline
std
::
string
printValue
(
char32_t
const
(
*
val
)[
N
])
{
return
toUTF8
(
reinterpret_cast
<
const
char32_t
*
const
>
(
val
),
N
,
'U'
);
return
toUTF8
(
reinterpret_cast
<
const
char32_t
*
const
>
(
val
),
N
,
'U'
);
}
}
template
<
size_t
N
>
template
<
size_t
N
>
std
::
string
printValue
(
wchar_t
const
(
*
val
)[
N
])
{
inline
std
::
string
printValue
(
wchar_t
const
(
*
val
)[
N
])
{
return
toUTF8
(
reinterpret_cast
<
const
wchar_t
*
const
>
(
val
),
N
,
'L'
);
return
toUTF8
(
reinterpret_cast
<
const
wchar_t
*
const
>
(
val
),
N
,
'L'
);
}
}
template
<
size_t
N
>
template
<
size_t
N
>
std
::
string
printValue
(
char
const
(
*
val
)[
N
])
{
inline
std
::
string
printValue
(
char
const
(
*
val
)[
N
])
{
return
toUTF8
(
reinterpret_cast
<
const
char
*
const
>
(
val
),
N
,
1
);
return
toUTF8
(
reinterpret_cast
<
const
char
*
const
>
(
val
),
N
,
1
);
}
}
...
@@ -124,13 +124,13 @@ namespace cling {
...
@@ -124,13 +124,13 @@ namespace cling {
// Forward declaration, so recursion of containers possible.
// Forward declaration, so recursion of containers possible.
template
<
typename
T
>
std
::
string
printValue
(
const
T
*
V
,
const
void
*
=
0
);
template
<
typename
T
>
std
::
string
printValue
(
const
T
*
V
,
const
void
*
=
0
);
template
<
typename
T
>
std
::
string
template
<
typename
T
>
inline
std
::
string
printValue
(
const
T
&
V
,
typename
std
::
enable_if
<
printValue
(
const
T
&
V
,
typename
std
::
enable_if
<
std
::
is_pointer
<
decltype
(
&
V
)
>::
value
>::
type
*
=
0
)
{
std
::
is_pointer
<
decltype
(
&
V
)
>::
value
>::
type
*
=
0
)
{
return
printValue
(
&
V
);
return
printValue
(
&
V
);
}
}
template
<
typename
T0
,
typename
T1
>
std
::
string
template
<
typename
T0
,
typename
T1
>
inline
std
::
string
printValue
(
const
std
::
pair
<
T1
,
T0
>*
V
,
const
void
*
AsMap
=
0
)
{
printValue
(
const
std
::
pair
<
T1
,
T0
>*
V
,
const
void
*
AsMap
=
0
)
{
if
(
AsMap
)
if
(
AsMap
)
return
printValue
(
&
V
->
first
)
+
" => "
+
printValue
(
&
V
->
second
);
return
printValue
(
&
V
->
first
)
+
" => "
+
printValue
(
&
V
->
second
);
...
@@ -150,7 +150,7 @@ namespace cling {
...
@@ -150,7 +150,7 @@ namespace cling {
// vector, set, deque etc.
// vector, set, deque etc.
template
<
typename
CollectionType
>
template
<
typename
CollectionType
>
auto
printValue_impl
(
inline
auto
printValue_impl
(
const
CollectionType
*
obj
,
const
CollectionType
*
obj
,
typename
std
::
enable_if
<
typename
std
::
enable_if
<
std
::
is_reference
<
decltype
(
*
(
obj
->
begin
()))
>::
value
>::
type
*
=
0
)
std
::
is_reference
<
decltype
(
*
(
obj
->
begin
()))
>::
value
>::
type
*
=
0
)
...
@@ -171,7 +171,7 @@ namespace cling {
...
@@ -171,7 +171,7 @@ namespace cling {
// As above, but without ability to take address of elements.
// As above, but without ability to take address of elements.
template
<
typename
CollectionType
>
template
<
typename
CollectionType
>
auto
printValue_impl
(
inline
auto
printValue_impl
(
const
CollectionType
*
obj
,
const
CollectionType
*
obj
,
typename
std
::
enable_if
<
typename
std
::
enable_if
<
!
std
::
is_reference
<
decltype
(
*
(
obj
->
begin
()))
>::
value
>::
type
*
=
0
)
!
std
::
is_reference
<
decltype
(
*
(
obj
->
begin
()))
>::
value
>::
type
*
=
0
)
...
@@ -191,14 +191,14 @@ namespace cling {
...
@@ -191,14 +191,14 @@ namespace cling {
// Collections
// Collections
template
<
typename
CollectionType
>
template
<
typename
CollectionType
>
auto
printValue
(
const
CollectionType
*
obj
)
inline
auto
printValue
(
const
CollectionType
*
obj
)
->
decltype
(
collectionPrinterInternal
::
printValue_impl
(
obj
),
std
::
string
())
{
->
decltype
(
collectionPrinterInternal
::
printValue_impl
(
obj
),
std
::
string
())
{
return
collectionPrinterInternal
::
printValue_impl
(
obj
);
return
collectionPrinterInternal
::
printValue_impl
(
obj
);
}
}
// Arrays
// Arrays
template
<
typename
T
,
size_t
N
>
template
<
typename
T
,
size_t
N
>
std
::
string
printValue
(
const
T
(
*
obj
)[
N
])
{
inline
std
::
string
printValue
(
const
T
(
*
obj
)[
N
])
{
if
(
N
==
0
)
if
(
N
==
0
)
return
valuePrinterInternal
::
kEmptyCollection
;
return
valuePrinterInternal
::
kEmptyCollection
;
...
@@ -213,7 +213,7 @@ namespace cling {
...
@@ -213,7 +213,7 @@ namespace cling {
// Tuples
// Tuples
template
<
class
...
ARGS
>
template
<
class
...
ARGS
>
std
::
string
printValue
(
std
::
tuple
<
ARGS
...
>
*
);
inline
std
::
string
printValue
(
std
::
tuple
<
ARGS
...
>
*
);
namespace
collectionPrinterInternal
{
namespace
collectionPrinterInternal
{
// We loop at compile time from element 0 to element TUPLE_SIZE - 1
// We loop at compile time from element 0 to element TUPLE_SIZE - 1
...
@@ -249,7 +249,7 @@ namespace cling {
...
@@ -249,7 +249,7 @@ namespace cling {
};
};
template
<
class
T
>
template
<
class
T
>
std
::
string
tuplePairPrintValue
(
T
*
val
)
inline
std
::
string
tuplePairPrintValue
(
T
*
val
)
{
{
std
::
string
ret
(
"{ "
);
std
::
string
ret
(
"{ "
);
ret
+=
collectionPrinterInternal
::
tuplePrinter
<
T
>::
print
(
val
);
ret
+=
collectionPrinterInternal
::
tuplePrinter
<
T
>::
print
(
val
);
...
@@ -259,7 +259,7 @@ namespace cling {
...
@@ -259,7 +259,7 @@ namespace cling {
}
}
template
<
class
...
ARGS
>
template
<
class
...
ARGS
>
std
::
string
printValue
(
std
::
tuple
<
ARGS
...
>
*
val
)
inline
std
::
string
printValue
(
std
::
tuple
<
ARGS
...
>
*
val
)
{
{
using
T
=
std
::
tuple
<
ARGS
...
>
;
using
T
=
std
::
tuple
<
ARGS
...
>
;
if
(
std
::
tuple_size
<
T
>::
value
==
0
)
if
(
std
::
tuple_size
<
T
>::
value
==
0
)
...
@@ -268,7 +268,7 @@ namespace cling {
...
@@ -268,7 +268,7 @@ namespace cling {
}
}
template
<
class
...
ARGS
>
template
<
class
...
ARGS
>
std
::
string
printValue
(
std
::
pair
<
ARGS
...
>
*
val
)
inline
std
::
string
printValue
(
std
::
pair
<
ARGS
...
>
*
val
)
{
{
using
T
=
std
::
pair
<
ARGS
...
>
;
using
T
=
std
::
pair
<
ARGS
...
>
;
return
collectionPrinterInternal
::
tuplePairPrintValue
<
T
>
(
val
);
return
collectionPrinterInternal
::
tuplePairPrintValue
<
T
>
(
val
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment