Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
condenser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Show more breadcrumbs
hive
condenser
Commits
d9204a25
Commit
d9204a25
authored
8 years ago
by
Daniel Larimer
Browse files
Options
Downloads
Patches
Plain Diff
adding strcmp_less
parent
0cfef4c4
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
include/chainbase.hpp
+24
-0
24 additions, 0 deletions
include/chainbase.hpp
with
24 additions
and
0 deletions
include/chainbase.hpp
+
24
−
0
View file @
d9204a25
...
...
@@ -31,6 +31,30 @@ namespace chainbase {
typedef
bip
::
basic_string
<
char
,
std
::
char_traits
<
char
>
,
allocator
<
char
>
>
shared_string
;
struct
strcmp_less
{
bool
operator
()(
const
shared_string
&
a
,
const
shared_string
&
b
)
const
{
return
less
(
a
.
c_str
(),
b
.
c_str
()
);
}
bool
operator
()(
const
shared_string
&
a
,
const
std
::
string
&
b
)
const
{
return
less
(
a
.
c_str
(),
b
.
c_str
()
);
}
bool
operator
()(
const
std
::
string
&
a
,
const
shared_string
&
b
)
const
{
return
less
(
a
.
c_str
(),
b
.
c_str
()
);
}
private
:
inline
bool
less
(
const
char
*
a
,
const
char
*
b
)
const
{
return
std
::
strcmp
(
a
,
b
)
<
0
;
}
};
class
database
;
/**
...
...
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