Comments (9)
Alright, hopefully that solves that :)
from tortellini.
You should just use std::equal
.
from tortellini.
Fantastic catch, that would have caused some headache later.
Thank you very much.
from tortellini.
e62d812#diff-f018793c8a8f1398780f8e4e1e82e39fR120
You should keep r.end()
, because otherwise std::equal
will go past the end of r
if it's smaller than l
. In your code it will never happen because it require that l
contain a \0
in the middle of the string (std::string
support this) but better safe than sorry.
(@Qix- not sure if you will receive a notification for this comment because the issue is already closed so i tag you, and thanks for the rewards on reddit)
from tortellini.
It wouldn't compile for me when I tried - I'll try again.
And no problem, I appreciate the review very much. :)
from tortellini.
That overload of std::equal
isn't available until c++17 c++14 it appears.
Will do some more research.
from tortellini.
You can just check that l.size() == r.size()
before calling std::equal
if you don't use C++14.
from tortellini.
Man I really must be tired, that is a much better solution.
from tortellini.
By the way, usually you still get notifications on github even after an issue is closed. Once you participate in an issue/PR you have to manually opt-out with the notifications button on the right; the issue status doesn't affect your notifications :)
Thanks again!
from tortellini.
Related Issues (9)
- Suggestion - Add stable versions of the library to the release page HOT 1
- need fix HOT 5
- Readme docs for running test are outdated HOT 1
- The root CMakeLists doesn't export the library HOT 1
- `string` to `long double` HOT 2
- Can not handle byte order mark at beginning of UTF-8 text files HOT 1
- Reading a char from the file HOT 2
- Reading a bool from a file HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tortellini.