Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensuring that poly<C, non_owning_storage, V> is trivially copyable. #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brevzin
Copy link

@brevzin brevzin commented Jan 14, 2019

This is the boring boilerplate bullshit that makes it possible for poly<C, non_owning_storage> to be trivially copyable - which is just a nice thing in certain contexts. There are more steps to take to improve this (i.e. there are several concepts that make no sense to type erase for non_owning_storage and we can just remove them), so this is just the first go.

@brevzin
Copy link
Author

brevzin commented Jan 14, 2019

I... don't understand the failure, sorry. You're gonna have to give me a hint:

In file included from /home/travis/build/ldionne/dyno/benchmark/n_functions.cpp:7:0:
/home/travis/build/ldionne/dyno/dependencies/install/include/benchmark/benchmark.h: In instantiation of ‘void benchmark::DoNotOptimize(Tp&) [with Tp = {anonymous}::handrolled_local::any]’:
/home/travis/build/ldionne/dyno/benchmark/n_functions.cpp:231:31:   required from ‘void BM_any_1_function(benchmark::State&) [with Any = {anonymous}::handrolled_local::any]’
/home/travis/build/ldionne/dyno/benchmark/n_functions.cpp:294:1:   required from here
/home/travis/build/ldionne/dyno/dependencies/install/include/benchmark/benchmark.h:324:48: error: read-only reference ‘value’ used as ‘asm’ output
   asm volatile("" : "+m,r"(value) : : "memory");
                                                ^

@leokoppel
Copy link

Hi Barry, the build failure looks unrelated to this PR.

This error is caused by calling benchmark::DoNotOptimize with a non-const reference to an object that contains a const subobject. I see Louis has already reported the issue: google/benchmark#764

I'm just here because this was the only search result for "error: read-only reference" "used as ‘asm’ output", so hopefully that helps someone else 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants