Alex Rivera | Logout

C++0x - export gone, exception specs deprecated. Will this affect your code?

Asked 2010-03-14T10:51:58.273
27

This latest Herb Sutter trip report on the C++0x standardisation process indicates that the committee has decided to completely drop the "export" concept for templates, and to deprecate exception specifications.

I think these are both good moves, but I'm interested if anyone out there has a code base where these changes will cause them sleepless nights?

Edit
Report

2 Answers

3

I certainly won't shed a tear over exception specification. ("A good idea which, unfortunately, never worked out.") All they ever were good for were what now noexcept stands for.

But I had hoped that export would make it. As the very least, export would allow you to change helper functions for templates without having to re-compile all the code using those templates. And it would get us rid of all those detail namespaces:

namespace detail { // actually we don't want this public, but can't avoid it
  template<typename T>
  void f_helper() { /*---*/ }
}

template<typename T>
void f() {detail::f_helper();}

void g() {f<int>();} // has to recompile if f_helper()'s implementation changes

Alas, since only one of the compilers I had to use during the last decade ever implemented it, I could never use it.

answered 2010-03-14T11:33:32.733
1

I think both moves are good and neither will cause me any pain and I like the clarification of intent with regards to noexcept.

answered 2010-03-14T11:09:36.440

Your Answer