Questions tagged [tr1]

TR1 - C++ Technical Report 1, proposed extensions to the C++ standard library

The Technical Report on C++ Library Extensions (a.k.a ISO/IEC TR 19768) defined a number of new library components for C++, many taken from the Boost project. Nearly all the components in TR1 were included in the C++ 2011 standard.

232 questions
7
votes
3 answers

C++ vs vs vs

I'm currently looking for a better alternative to std::map and have come across classes mentioned in the post title. Could someone clarify the differences between them, not in terms of performance/API, but in terms of where they beleong in relation…
Graeme
  • 4,514
  • 5
  • 43
  • 71
7
votes
1 answer

OS-X support for std::tr1

What is the current support for tr1 or the new C++0x on the Mac I know that the gcc supplied with XCode is always a couple of versions behind that available from gcc.gnu.org so I was just wondering what the state of play for modern support was. For…
Martin York
  • 257,169
  • 86
  • 333
  • 562
6
votes
0 answers

Extending std namespace with backported code

Some background: Extending namespace std is undefined-behaviour(UB) unless it is a template specialization [1]: It is undefined behavior to add declarations or definitions to namespace std or to any namespace nested within std, with a few …
AMA
  • 4,114
  • 18
  • 32
6
votes
2 answers

C++ TR1 regex - multiline option

I thought that $ indicates the end of string. However, the following piece of code gives "testbbbccc" as a result, which is quite astonishing to me... This means that $ actually matches end of line, not end of the whole string. #include…
R.P.
  • 61
  • 1
  • 2
6
votes
3 answers

std::tr1::mem_fn return type

I want to put the result of this: std::tr1::mem_fn(&ClassA::method); Inside a variable, what is the type of this variable ? That will look something like this: MagicalType fun = std::tr1::mem_fn(&ClassA::method); Also, what is the result type of…
Tarantula
  • 19,031
  • 12
  • 54
  • 71
6
votes
3 answers

Is TR2 Going to be Released in C++17?

There is lots of sweet stuff in TR2. Is that going to be in C++17? I understand that TR1 was completed in 2005 and had to wait until C++11 to be standardized. But I also understand that TR2 is already complete? My link to C++17 doesn't mention…
Jonathan Mee
  • 37,899
  • 23
  • 129
  • 288
6
votes
5 answers

Is it worth using std::tr1 in production?

I'm using MS VC 2008 and for some projects Intel C++ compiler 11.0. Is it worth using tr1 features in production? Will they stay in new standard? For example, now I use stdext::hash_map. TR1 defines std::tr1::unordered_map. But in MS implementation…
flashnik
  • 1,900
  • 4
  • 19
  • 38
6
votes
1 answer

confusion between std::[tr1::]ref and boost::ref

Beware: This is GCC 4.1.2. We're on a proprietary embedded platform. We cannot update to a new compiler. So C++03 + TR1 it is. We somewhere have a function like this: template void foo(const boost::any& x) { …
sbi
  • 219,715
  • 46
  • 258
  • 445
6
votes
4 answers

Reversing strings in a vector using for_each and bind

I was wandering how it's possible to reverese strings that are contained in a vector using a single for_each command just in one "simple" line. Yea, I know it is easy with a custom functor, but I can't accept, that it can't be done using bind (at…
fmuecke
  • 8,708
  • 1
  • 20
  • 25
6
votes
3 answers

Does std::function's copy-constructor require the template type's argument types to be complete types?

Given: #include class world_building_gun; class tile_bounding_box; typedef std::function worldgen_function_t; void foo() { worldgen_function_t v; worldgen_function_t w(v); } Should…
idupree
  • 730
  • 5
  • 16
6
votes
1 answer

operator== and list::remove()

Test.h #ifndef TEST_H #define TEST_H #include template bool operator==(const std::weak_ptr& wp1, const std::weak_ptr& wp2) { std::shared_ptr sp1; if(!wp1.expired()) sp1 =…
user987280
  • 1,578
  • 1
  • 14
  • 24
5
votes
1 answer

C++ make_shared not available

While I have std::tr1::shared_ptr available in my compiler, I don't have make_shared. Can someone point me to a proper implementation of make_shared? I see that I need to use varargs to provide arguments to constructor of T. But I don't have…
user231536
  • 2,661
  • 4
  • 33
  • 45
5
votes
7 answers

Comparing std::tr1::function<> objects

I've been trying to implement a C#-like event system in C++ with the tr1 function templates used to store a function that handles the event. I created a vector so that multiple listeners can be attached to this event, i.e.: vector< function
AlexG
  • 51
  • 2
  • 3
5
votes
5 answers

How to check for TR1 while compiling?

We are programming a logging library that keeps itself in a .hpp file. We would like to include (if the compiler supports TR1,) or the standard otherwise. Is there a standard way of checking at compile time if tr1 is…
Diego Sevilla
  • 28,636
  • 4
  • 59
  • 87
5
votes
2 answers

C++ Regex to match words without punctuation

I searched, couldn't find anything. In the interest of not wasting any more of my time on the chance that the answer is obvious to someone else, I'm asking here. Only site that has been useful so far is this one:…
Chris
  • 53
  • 1
  • 1
  • 3