
Thanks Steven!
If you have a compiler that support C++0x features, <something> can be auto.
Yeah I was thinking the same thing, I don't think I should stray into 0x land w/ this stuff yet. I thought about using a copy, and not to get too picky but it'd be so much slicker if I could just instantiate the vector inline. If I could write down the type I could at least create a helper that does the begin/end calls. I figure at least the way I was trying to do it was 2 lines instead of 3, and didn't have a non-const var lying around.
The following works for me with VC++ 2010:
I'm getting the same build errors with what you provided... I guess my
compiler has issues with this. I'm using XCode 4 w/ GCC 4.2 and boost
1.46.1. I get the same errors when I try LLVM 2.0. I thought I was
doing it about right :(.
Thanks again,
Jake
On Wed, Apr 6, 2011 at 2:21 PM, Steven Watanabe
AMDG
On 04/06/2011 01:50 PM, Jake Brownson wrote:
I love the ideas behind these libs, but I think I need to figure out a bit more before I can use them.
Here's an example that models what I'm trying to do for real as an experiment w/ using phoenix and range. I can't quite get it to build. I think I'm really close. I tried it w/ lambda before I found phoenix and I had to do some ret<> things to get past some errors, but I'm not sure what the equivalent in phoenix is, or if I should really need them.
Also, I think there should be a way to instantiate a vector directly from a range w/o having to use begin() and end() somehow, but I can't find it.
I've tried various approaches with<something> including transformed_range<> and any_range<> and haven't gotten them to work.
The transformed line gives me errors complaining about missing result_type, iterator_category, value_type, difference_type, pointer, reference.