Article Discussion
Your C++ Wish List
Summary: C++0x is under construction. Get your licks in while there's still time.
83 posts on 6 pages.      
« Previous 1 2 3 4 5 6 Next »
The ability to add new comments in this discussion is temporarily disabled.
Most recent reply: January 1, 2009 6:55 AM by
Chuck
Posts: 32 / Nickname: cda / Registered: February 11, 2003 0:06 PM
Your C++ Wish List
September 25, 2004 8:00 PM      
C++0x is under construction. Get your licks in while there's still time.

http://www.artima.com/cppsource/wishlist.html
S.
Posts: 1 / Nickname: impatient / Registered: November 11, 2003 7:24 AM
Re: Your C++ Wish List (Editorial)
September 27, 2004 7:36 AM      
I don't know if I read the wish list well but I didn't see
anny mentioning of the following in the requests for enhancements to the STL:

-- Smart pointer objects (See Josuttis' book or look at the boost library cases)

-- HASH containers... come on this one is a must!

And also, can someone appoint some people that actually program in C++ to that commision. That would make a difference as most practical issues are usually ignored in order to get some theoretical perfection that is never reached.
Chuck
Posts: 32 / Nickname: cda / Registered: February 11, 2003 0:06 PM
Re: Your C++ Wish List (Editorial)
September 27, 2004 7:29 PM      
Actually, the two items you mention are very high in the list. The Boost smart pointers are the basis for what is now being discussed for C++0x. Also, a hash table proposal is being reviewed, so, you're in good company!
old
Posts: 1 / Nickname: oldtimer / Registered: September 27, 2004 6:11 PM
Re: Your C++ Wish List (Editorial)
September 27, 2004 10:30 PM      
>11. Extended type information (as much runtime type information as possible for a compiled language)

I guess this would cover introspection (by applying this extended type information to instances).

I would add to this: arbitrary user-created meta data for all constructs. I know this isn't an easy one, but getting something anywhere towards this ideal would be really great.

It's a feature that helps make introspection really useful. For example, when pushing introspection to do persistence, GUI editing, report making, etc. Arbitrary meta data lets you mark up the classes/fields with all sorts of things like a description, or a read-only marker, or marking things as primary state vs derived state, or setting policies for GUI editing (like to say that this Vector2 is a position in the space defined by _that_ transform).

I'm a die hard C++ programmer, but after working with C# for a bit, I found myself wishing C++ could do this. I know it's not fashionable for C++ to add features that "C++ replacement languages" have, but let's just say we are inspired by lisp or something...
Thorsten
Posts: 1 / Nickname: tbentrup / Registered: September 27, 2004 11:26 PM
Re: Your C++ Wish List (Editorial)
September 28, 2004 3:58 AM      
I like templates and use them frequently and the most libraries are based on them too, but what I miss is the possibility to define templates with an unknown number of parameters.
The BOOST tuple class or signal/slot classes or many others use copy & paste (or the preprocessor) and they are all limited to a fixed maximal count of parameters (e.g. 3 or 5 or 10).

It would be nice, if C++ could itself construct templates with any number of parameters (as '...' in printf()).

extensions to C++:

- '...' in templates
- '##' is the number of '...' parameters (N)
- '#' iterates over all the parameters (1 - N)

examples:


template<class A, ...> class X
{
typedef # arg#_type;

X(A a, ...) { }
};

template<class T, ...> f(const T& t, ...)
{
g(t, ...);
}

template<typename F, typename T, ...>
class result_of<F(...)>
{
static F f;
static # t#;

public:
typedef typeof(f(...)) type;
};

template <...>
struct group
{
# a#;
group(...)
: a#(#...)
{}
};

template <class Ch, class Tr, ...>
inline
BOOST_IO_STD basic_ostream<Ch, Tr>&
operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
const group<...>& x)
{
os << x.a#;
return os;
}


I know this is hard work for compiler vendors but this would replace many copy & paste code and fewer use of the preprocessor.

I would also appreciate, if the header guards (with "#ifdef") could be replaced by another command
(e.g. "#pragma once" like some (but not all) vendors do - I know that this is another pp-command, but easier to use).
Christian
Posts: 1 / Nickname: cocus / Registered: September 30, 2004 2:26 AM
Re: Your C++ Wish List (Editorial)
September 30, 2004 6:30 AM      
I would hop for templated typedefs as a means to alias template names. THis greatly would faciliate metaprogramming and would also make C++ more consitent.
Nemanja
Posts: 40 / Nickname: ntrif / Registered: June 30, 2004 1:10 AM
Re: Your C++ Wish List (Editorial)
October 1, 2004 8:39 AM      
1. "Controlled virtuality" - like in C# or (even better) C++/CLI. Right now, if you declare a function virtual in a parent class, virtuality will automatically be inherited even if it is not really needed. For instance:

struct IMyInterface {
virtual void fun() = 0;
};

struct MyImplementation {
void fun(); // this one is also virtual
};

In order not to break existing code, maybe it would be a good idea to add a keyword that would "stop" a function from being virtual:

struct MyImplementation {
nonvirtual void fun(); // this one is not virtual
};

2. XML API. I agree we need a good XML API. However, I would strongly suggest to avoid DOM which is non-efficient and not "C++ friendly". Some cursor-based model would be much better, IMHO.
Nemanja
Posts: 40 / Nickname: ntrif / Registered: June 30, 2004 1:10 AM
Re: Your C++ Wish List (Editorial)
October 1, 2004 8:41 AM      
Of course, I meant:

struct MyImplementation : IMyInterface {
void fun(); // this one is also virtual
};
Chris
Posts: 3 / Nickname: cdutton / Registered: July 20, 2004 9:25 PM
Re: Your C++ Wish List (Editorial)
October 2, 2004 1:42 PM      
How about templated namespaces?
Chuck
Posts: 32 / Nickname: cda / Registered: February 11, 2003 0:06 PM
Re: Your C++ Wish List (Editorial)
October 3, 2004 7:14 AM      
> How about templated namespaces?

Could you elaborate on that?
Chris
Posts: 3 / Nickname: cdutton / Registered: July 20, 2004 9:25 PM
Re: Your C++ Wish List (Editorial)
October 4, 2004 11:40 PM      
> > How about templated namespaces?
>
> Could you elaborate on that?

I'm not entirely sure I can. By that I mean that I can't foresee all of the side-effects it might have, or weird and possibly uncouth ways in which such a thing might be used.

I do seem to remember at leat a few projects which involved creating numerous templated classes where it seemed every template was using the same information. Rather than specifying that information for each object I used, and thus potentially screwing it up in numerous places, it would have saved a fair amount of time if I had been able to apply that template to the namespace I had wrapped all of those classes in.
Steve
Posts: 8 / Nickname: essennell / Registered: September 7, 2004 10:19 PM
Re: Your C++ Wish List (Editorial)
October 5, 2004 6:28 AM      
> Rather than specifying that information for each object I
> I used, and thus potentially screwing it up in numerous
> places, it would have saved a fair amount of time if I had
> been able to apply that template to the namespace I had
> wrapped all of those classes in.

Hmmm. Given that a namespace can be re-opened in several source files, this would place a bit of a burden on other people populating that NS.

I don't see it would save you much.

template< typename T >
namespace X
{
   class Z
   {
   };
}
using X< int >::Z;


How do you get an object of type Z?

Z< int > z;
//or
Z z;


You lose ease of understanding for ease of typing.
Steve
Posts: 1 / Nickname: stheller / Registered: October 6, 2004 10:07 AM
Re: Your C++ Wish List (Editorial)
October 6, 2004 2:11 PM      
I would like some language/library support for an automatic way to use polymorphism without needing to expose pointers/memory management to the application program. I have developed ways to do this, based on the Coplien "envelope/letter" idiom, but more convenient and flexible. From my experience, I'm pretty sure that many other C++ developers could benefit greatly from support for such a feature, as it is far from obvious how to implement it unless you have seen it before.
jgh
Posts: 1 / Nickname: jgh / Registered: October 7, 2004 7:13 AM
Re: Your C++ Wish List (Editorial)
October 7, 2004 11:15 AM      
No need to be bashful. Can you give us a taste of what you're referring to?
siva
Posts: 1 / Nickname: podian / Registered: October 8, 2004 7:18 AM
Re: Your C++ Wish List (Editorial)
October 8, 2004 11:21 AM      
What about synchronized keyword to synchronize the whole method (like Java)? This will ensure that programmers do not forget to unlock a semaphore when they return from a middle of a function.
83 posts on 6 pages.
« Previous 1 2 3 4 5 6 Next »