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

std::regex and std::tr1::regex compatible?

Is std::regex and std::tr1::regex totally compatible? The former is available since C++11. I want to migrate to std::regex. I use MSVC 2012/2013.
linquize
  • 19,828
  • 10
  • 59
  • 83
0
votes
1 answer

Retrieving the results from the std::tr1::regex_search

I have a confusion on how to fetch the result after running the function regex_search in the std::tr1::regex. Following is a sample code to demonstrate my issue. string source = "abcd 16000 "; string exp = "abcd ([^\\s]+)"; std::tr1::cmatch…
S_R
  • 493
  • 1
  • 9
  • 22
0
votes
3 answers

C++ a NULL pointer in the STL container

I am, unfortunately, not working on a program developed by myself fully. I recently I noticed a Visual Studio Fatal Error on operator-- of unordered_set, which was called from simple insertion of a pointer to unordered_set. After reviewing the…
Stranger
  • 1
  • 1
  • 2
0
votes
1 answer

Hash function for indices greater than 64-bits?

From the C++ standard, the hash function std::tr1::hash computes hash values whose range is 64-bits (correct me if i'm wrong). But out of curiosity, are there any mechanisms that generate hash values with range greater than 64-bit. My question may…
annunarcist
  • 1,637
  • 3
  • 20
  • 42
0
votes
1 answer

Conventions for dealing with vectors of std::tr1::shared_ptr

I've started using std::tr1::shared_ptr and so far I'm quite liking it. I understand some of the pitfalls (e.g. two classing containing smart pointer members to each other). But there are other cases which I'm unsure about whether to use smart…
memo
  • 3,554
  • 4
  • 31
  • 36
0
votes
1 answer

Regex pattern help wanted

The raw string is like this: {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fcharset0 Times New Roman;}{\f1\fnil\fcharset0 MS Shell Dlg…
val
  • 151
  • 1
  • 10
0
votes
2 answers

Can I use C++ TR1 in VS2010?

We have some code written with TR1, e.g.: #include ... typedef std::tr1::function MyFunction; .. It works fine by compiling with GCC, but failed with VS2010. Our code has compatibility issue with C++11 so I'm afraid I…
Deqing
  • 14,098
  • 15
  • 84
  • 131
0
votes
1 answer

Best way to store and hash key (C++)

My goal is to create an efficient structure to store the most relevant entries of a matrix that would (in a world without memory limitations) be approximately 10^5 x 10^5 and filled with doubles. The matrix is symmetric, so it actually would contain…
Sarah
  • 1,614
  • 1
  • 23
  • 37
0
votes
2 answers

Compilation Error when using tr1::function

The purpose is to execute CVS890Executor::do_full_frame when calling the m_callback_fn within CDevVS890. Following is the incriminated code: "CDevVS890.h" typedef std::tr1::function DoFrameFn; class…
0
votes
1 answer

Using tr1::regex_search to match a big list of strings

I need to match any of a list of strings, and I'm wondering if I can just use a regular expression that is something like "item1|item2|item3|..." instead of just doing a separate strstr() for each string. But the list can be fairly large - up to…
sashoalm
  • 75,001
  • 122
  • 434
  • 781
0
votes
1 answer

Get index of match from tr1::regex_search

How can I get the index of the match when using std::tr1::regex_search? // sequence of string sub-matches std::tr1::smatch result; if (!std::tr1::regex_search(text, result, pattern)) return false; I can get only the string from the…
sashoalm
  • 75,001
  • 122
  • 434
  • 781
0
votes
2 answers

Accessing a nested pair

To take apart a pair, the following can be done boost::bind(&std::pair::second, _1); // returns the value of a pair What about using combinations of different containers, how can a nested pair be accessed? For example when I wanted to partition a…
Peter Nimmo
  • 1,045
  • 2
  • 12
  • 25
0
votes
2 answers

'No Match' Errors with a member callback function using std::tr1::function

I am trying to create a callback function using str::tr1::function pointing to a public member function. std::tr1::function < int (const string& , const MessageInfo* , const void* , const int , const void* ) > dssCallBack; dssCallBack =…
Chinmay Nerurkar
  • 495
  • 6
  • 22
0
votes
1 answer

Tokenize with colon using std::tr1::regex

I'm working on a quasi-SCPI command parser and I want to split a string based on colons, ignoring quoted strings. I want to get an empty string if there is no text between colons. If I use this regex expression in EditPad Pro 7.2.2, it does…
Ryan Clark
  • 23
  • 6
0
votes
2 answers

Implementing std::equal with tr1::shared_ptr types

Could not easily find a solution online... I have something similar to the following. class Color { public: Color(std::string n) : name(n) {} typedef std::tr1::shared_ptr Ptr; std::string name; }; meanwhile elsewhere... void…
bgura
  • 860
  • 15
  • 33
1 2 3
15
16