User Profile

Collapse

Profile Sidebar

Collapse
nielsp
nielsp
Last Activity: Aug 1 '09, 08:13 AM
Joined: Jul 19 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • nielsp
    replied to iterate over tuple
    in C
    Hi!

    I understood the mistakes I made. The Listener-related error has nothing to do with the problem, that the symbol does'nt exists, I just wanted to simplify the code in order to make it easer to read, so I renamed Listener to T, but the error exists although (cannot expand 'T' ... instead of cannot expand 'Listener') .
    I got some helpful answers at stackoverflow.c om, so here is the version that works:
    Code:
    template<class
    ...
    See more | Go to post

    Leave a comment:


  • nielsp
    replied to iterate over tuple
    in C
    Is it impossible or what?
    See more | Go to post

    Leave a comment:


  • nielsp
    replied to iterate over tuple
    in C
    The document does not say anything about iterating over tuples. By the way, I am using tuples of C++0x. Although those tuples are probably derived from the boost library, it might be not absolutly the same.

    Niels.
    See more | Go to post

    Leave a comment:


  • nielsp
    started a topic iterate over tuple
    in C

    iterate over tuple

    Hello!

    How can I iterate over a tuple (using C++0x)? I tried the following, but that doesn't work:
    Code:
    for(int i=0; i<std::tuple_size<T...>::value; ++i) 
        std::get<i>(my_tuple).do_sth();
    Error 1: sorry, unimplemented: cannot expand ‘Listener ...’ into a fixed-length argument list.
    Error 2: i cannot appear in a constant expression.

    So, how do I correctly...
    See more | Go to post

  • nielsp
    replied to invalid use of nonstatic member
    in C
    Is there a way to access m although?

    Niels
    See more | Go to post

    Leave a comment:


  • nielsp
    started a topic invalid use of nonstatic member
    in C

    invalid use of nonstatic member

    Hi!

    Why does'nt the following work?

    Code:
    #include <iostream>
    
    class X
    {
    public:
    	X()
    	 : m(0)
    	{ }
    	
    	virtual ~X()
    	{ }
    	
    protected:
    	int m;
    };
    
    class Y : public X
    {
    private:
    	class Z 
    	{
    		void do_something() 
    		{
    			std::cout << m << std::endl;
    ...
    See more | Go to post
No activity results to display
Show More
Working...