- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
After spending one day debugging some code I've found some really strange behaviour: Consider the following code
[cpp]
#include<iostream>
#include<type_traits>
struct A {
A(A&& other) noexcept {}
~A() noexcept {}
};
struct B {
B(B&& other) noexcept {
}
~B() {}
};
int main() {
std::cout << std::is_nothrow_move_constructible<A>::value << std::endl;
std::cout << std::is_nothrow_move_constructible<B>::value << std::endl;
}
[/cpp]
If I compile this with Intel Composer XE2014 SP1 Update 1 on Windows I get the following output on the the console:
[cpp]
1
0
[/cpp]
This means essentially that std::is_no_throw_move_constructible returns true only if the Move constructor AND the Destructor are marked as noexcept. I think this is not what is written in the standard. (gcc 4.8.2 and Clang 3.4 give the correct outpout, i.e. 1,1)
Cheers,
Raffael
P.S.: You can find the source code also attached to this message.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is the for the same reason as your other note, we do not support implicit noexcept on the Windows platform.
http://software.intel.com/en-us/forums/topic/500462
From our code:
/* Microsoft compilers do not yet (as of Visual C++ 2013) implement
noexcept. We therefore keep the traditional relaxed semantics for
destructors and operator delete. */
implicit_noexcept_enabled = FALSE;
Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Judy,
Okay thanks for the answer. It's really too bad that it doesn't work completly but I have been able to work around it.
Cheers,
Raffael

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page