- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, when some class (T) has destructor is_trivially_copy_constructible<T>::value is always false.
For example:
//trivially copy constructable class with destructor class CSomeClass { public: int x; //explicitly specify default copy constructor CSomeClass(const CSomeClass&) = default; //non-default destructor ~CSomeClass(){ } }; //all asserts below are failed static_assert(is_trivially_copy_constructible<CSomeClass>::value, "not a trivially copy constructable"); static_assert(is_trivially_move_constructible<CSomeClass>::value, "not a trivially move constructable"); static_assert(is_trivially_constructible<CSomeClass, const CSomeClass&>::value, "not a trivially copy constructable"); static_assert(is_trivially_constructible<CSomeClass, CSomeClass&&>::value, "not a trivially copy constructable");
If we remove destructor, all assertion will pass.
According C++11 specification (in my case I refer to draft n3376), is_trivially_copy_constructible<T> should be true when is_copy_constructible<T> is true and only trivial operations are involved.
So I think is_trivially_copy_constructible should be true in the above example.
I have installed the following compiler: Intel® C++ Composer XE 2015 Package ID : w_ccompxe_2015.0.030, for Microsoft* Visual Studio* 2013.
Btw, with ms vc120 compiler, all asserts are pass.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Andrey,
I can reproduce the issue, I will track the issue in our problem tracking system. Hope to see it fixed (implemented) in future.
Note: This C++11 feature is even not supported by latest gcc 4.9.0 and ICC 15.0 Linux version.
Thanks,
Shenghong
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Andrey,
I can reproduce the issue, I will track the issue in our problem tracking system. Hope to see it fixed (implemented) in future.
Note: This C++11 feature is even not supported by latest gcc 4.9.0 and ICC 15.0 Linux version.
Thanks,
Shenghong

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