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
0
votes
1 answer

Is tr1 array supposed to be 16 byte aligned?

In "gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)" in tr1 array, I see this: value_type _M_instance[_Nm ? _Nm : 1] __attribute__((__aligned__)); whereas in "gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)", I see…
amos
  • 5,092
  • 4
  • 34
  • 43
0
votes
2 answers

c++ tr1 enable_shared_from_this what's the advantage?

I am currently reading through C++ TR1 extensions and started focussing on std::tr1::shared_ptr. So, I read so far that I can declare and initialize shared_ptr<> with this code: class foo {}; std::tr1::shared_ptr fsp(new…
Carsten Greiner
  • 2,928
  • 2
  • 16
  • 20
0
votes
3 answers

TR1 function multicast

How would you implement multicast for TR1 functors? I have my callback slots implemented like void setCallback(std::tr1::function cb) { this->callback = cb; } but need to pass more than one callback in one of them. I don't…
Adam Trhon
  • 2,915
  • 1
  • 20
  • 51
0
votes
0 answers

Pre-C++11 SFINAE in combination with ADL

I have to deal with Google Protobug packets defined in various namespaces: // Those are generated classes /// @file server.pb.h namespace Server { class ServerMsg1 : public ::google::protobuf::Message { }; class ServerMsg2 : public…
Swift - Friday Pie
  • 12,777
  • 2
  • 19
  • 42
0
votes
1 answer

Obtain Regular Expressions from file

I would like to be able to obtain a list of regular expressions from a file. I have tried reading the regexes into a char * or a std::string which works without a problem. However, converting them/using them as regexes proves to be fruitless, since…
user515751
  • 19
  • 3
0
votes
1 answer

TR1 regex_replace with wstring in VS2010?

#include #include #include #include #include using namespace std; int main () { const wstring wstr(L"<(.|\\n)*?>"); static const wregex wr(wstr); wstring line (L"Random text"); wstring line2…
0
votes
1 answer

Remove/replace Multicharacters (ÿû) in a C++ String

I am trying to replace the multicharacters in a string using std::tr1::regex as I am not able to find any function that can help to replace them. The code is as below: // Example program #include #include #include…
0
votes
2 answers

C++ library comparison: Boost and Tr1

Which is more robust? Coz I read Linus Torvalds 's article about how bad is boost. Is that tr1 is better than boost?
Josh Morrison
  • 7,488
  • 25
  • 67
  • 86
0
votes
2 answers

Regular expressions matching

I have one function for checking, whether entered line is "OK". #include bool lineIsValid(string line) { const tr1::regex pattern("[^-]{1,30} - [^-]{1,30}"); return tr1::regex_match(line, pattern); } lineIsValid("test -…
Radek Simko
  • 15,886
  • 17
  • 69
  • 107
0
votes
0 answers

problems with tr1/random

I tried to create a series of random numbers using uniform distribution whose limits are given from a file. void initialize ( string file_in_name ) { ifstream file_in; int i; int j; //lbound= lower value bound, ubound=upper value bound …
0
votes
0 answers

tr1 undefined reference std::tr1::basic_regex in external library

I am trying to compile a application that use a external library which i don't have the source code, only the headers. The errors I have are the following: ./libExternal.so: undefined reference to `bool…
FCS
  • 1
  • 1
0
votes
0 answers

Is there a implementation for VC6?

Are there any working implementations for Visual C++ 6? Specifcally I'm looking for std::enable_if and std::is_sameand std::remove_cv.
Zhro
  • 2,546
  • 2
  • 29
  • 39
0
votes
5 answers

Crazy C++ Vector iterator

I declare: typedef std::tr1::shared_ptr SharedPtr; And then: std::vector mList; And: typedef std::vector::iterator ListIterator; The return of mList.size() is 0, but when I use iterators, it iterates over the vector…
Tarantula
  • 19,031
  • 12
  • 54
  • 71
0
votes
2 answers

binding argument to ansi c callback

I have function, lets say foo, in lib which accepts callback: typedef void (*CallbackType)(unsigned int); void foo(const tchar* path, CallBackType); // library function static void boo(unsigned int percent) { static ProgressBarClass progressBar; …
0
votes
1 answer

Why does this preprocessor macro for toggling between C++11 and TR1 not work?

For instance, I'm trying this: #if __cplusplus >= 201103L #include typedef std::unordered_set UnorderedStringSet; #else #include typedef std::tr1::unordered_set
marathon
  • 7,881
  • 17
  • 74
  • 137