Comments (6)
I just had a look at both code fragments.
For both errors I doesn't see any flaw in the source code; especially I don't understand the error message of the Allocator::value_type and their context.
The first error may be a misinterpretation of AppleClang regarding overloaded member functions for both const and non-const objects or a more restrictive pointer arithmetic.
I'll test on a macOS.
from cppassist.
Regarding the second error:
using value_type = value<T, SIMD_SIZE>;
using allocator = cppassist::aligned_allocator<T, simd_size * sizeof(T)>;
using iterator = typename std::vector<value_type, allocator>::iterator;
The value type for the vector is value_type (which is value<T, SIMD_SIZE>).
The value type for the allocator is T.
T != value<T, SIMD_SIZE), hence the error message. It can be solved syntactically by
using allocator = cppassist::aligned_allocator<value_type, simd_size * sizeof(T)>;
however I'm not sure if this is correct semantically. Should at least read sizeof(value_type), I guess?
from cppassist.
I don't understand the first error at all. The function that is called in non-const, so the used version of data() should also be the non-const version. But it seems like the compiler chooses the const version of data() here. I don't know what to do here except circumventing this possible compiler bug by using a const_cast.
from cppassist.
I just want to add that clang 3.8 (the official clang, not apple clang) has no problem with the constness.
I will provide a const_cast solution.
from cppassist.
Somehow, the first error vanished while fixing the second one on apple clang 8.0.
from cppassist.
true, it's gone. So with luck this was just a very strange follow-up bug.
from cppassist.
Related Issues (20)
- Adjust code style
- File loader for .glraw files HOT 1
- Bool conversion tests fail
- Remove deprecated code
- Provide generic hasher for enum classes HOT 4
- Logging to multiple LogHandlers
- Rename io submodule
- Wrap free functions in cppassist namespace into own subnamespace
- FileLogHandler should open file only once
- Library name HOT 2
- Check conversion of string to float on macOS HOT 3
- Update README.md
- File system watcher HOT 3
- Move classes from globjects HOT 1
- Flag operators intefere with other libraries HOT 2
- Move classes from gloperate HOT 1
- Integrate ConvertUTF HOT 1
- Cleanup fs module
- Review cmdline module HOT 2
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 cppassist.