Re: C++ pushback



On Wed, Apr 26, 2006 at 06:00:52PM -0500, Roman Kononov wrote:
Linus Torvalds wrote:
- a lot of the C++ features just won't be supported sanely (ie the kernel
infrastructure just doesn't do exceptions for C++, nor will it run any
static constructors etc).
A lot of C++ features are already supported sanely. You simply need to
understand them. Especially templates and type checking. C++
exceptions are not very useful tool in kernels. Static constructor
issue is trivial. I use all C++ features (except exceptions) in all
projects: Linux kernel modules, embedded real-time applications,
everywhere. They _really_ help a lot.

Seriously, your code must be broken.

The C++ standard does not allow an allocator to return NULL, it is
supposed to raise an exception.

Jan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: advantages of C
    ... And constructors and destructors and templates and exceptions and ...
    (comp.programming)
  • Re: C++ in embedded systems
    ... >> exceptions or templates. ... > description of the library that would state "does not use exceptions ... devices with the compiler that is bundled with the OS. ... the exit/reset on error conditions didn't seem to be compared to EH ...
    (comp.os.linux.embedded)
  • Re: Benefits of Dynamic Typing
    ... exceptions because many of them are turned into exceptions by default. ... There are two families of dynamic typing: ... Emulation becomes hard when a statically typed language with closed ... I would say that C++ templates use a compile-time dynamic ...
    (comp.lang.functional)
  • Re: C vs C++ in Embedded Systems?
    ... This wasn't the main reason most people limited these features. ... Exceptions can be efficient in comparison to the alternative of ... Templates can be used just as smart type-checked macros. ... everything safely to have list-of-pointer-to-anything containers. ...
    (comp.arch.embedded)
  • Re: export (WAS: Boost Workshop at OOPSLA 2004) (WILL BE: Save Andrei)
    ... >> I can hardly imagine how anybody could argue that one. ... Templates aren't easy, exceptions ...
    (comp.lang.cpp)