Comments (8)
Maybe I forgot to pull updated code. The test passed. Everything works fine for now.
from scnlib.
It seems all the code should run correctly under Release mode.
But under Debug mode, whenever you operate an iterator with another one, such as
auto raw = "123456";
std::string_view s(raw);
std::string_view s(raw+2);
s.begin() - s2.begin(); // _STL_VERIFY fails:
/*
code in xstring:
_NODISCARD constexpr difference_type operator-(const _String_view_iterator& _Right) const noexcept {
#if _ITERATOR_DEBUG_LEVEL >= 1
_STL_VERIFY(_Mydata == _Right._Mydata && _Mysize == _Right._Mysize,
"cannot subtract incompatible string_view iterators");
return static_cast<difference_type>(_Myoff - _Right._Myoff);
#else // ^^^ _ITERATOR_DEBUG_LEVEL >= 1 ^^^ // vvv _ITERATOR_DEBUG_LEVEL == 0 vvv
return _Myptr - _Right._Myptr;
#endif // _ITERATOR_DEBUG_LEVEL
}
*/
MSVC will check if s and s2 points to the same buffer and have the same size. If not, exception is thrown.
Thus, the ranges intenally used by scn is not compatible with MSVC's std::string_view under Debug mode. Because write_return function will construct a new ranges(std::string_view), making all operators for iterator invalid.
from scnlib.
Aw bugger, it's those MSVC debug iterators again. I'll look into this on ~Monday, once I have access to a Windows PC.
from scnlib.
Fixed in 5b2eb91. Thanks for reporting!
from scnlib.
MSVC under Debug mode still not work.
The test string_view.cpp fails.
from scnlib.
It seems that under MSVC debug mode(_ITERATOR_DEBUG_LEVEL >=1), you must change the range recursively after calling write_return.
from scnlib.
How can I re-open this issue?
Or should I create a new issue?
from scnlib.
I can't get that assertion to fire on my Windows PC nor on Appveyor. Can you see if it does for you after 8b3ab27?
from scnlib.
Related Issues (20)
- gcc-10 won't compile with rvalue string_view as range HOT 1
- scan_list_ex: unable to use separator when scanning list of strings
- Capture matches in tuple HOT 1
- `scn::basic_string_view::substr` does not compile. HOT 1
- scn::scan_tuple compilation error with custom type HOT 1
- Cmake <3.5 deprecation warning HOT 1
- Quadratic Complexity Issue with scnlib's scan Function for Long Texts HOT 5
- Wich packages does this come with ? HOT 1
- Dead documentation link HOT 1
- Scan format "{} = ({}, {})" with std::string not properly parsed HOT 2
- issue with scn::getline on file input HOT 2
- Can't compile scnlib/2.0.0 on MSVC HOT 4
- Library not working in Godbolt Compiler explorer HOT 11
- cmake: Rejects compilation with simdutf-5.0.0 HOT 4
- Potential regression from v1.1.3 to v2.0.2 HOT 1
- No libc++ Support On Windows 11
- Failure scanning negative floating-point decimals HOT 2
- Single Header
- how to parse string
- Clang (clang-scan-deps) emits error about c++14 digit separator in preprocessor constants
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 scnlib.