tr1 Questions

1

Solved

Test.h #ifndef TEST_H #define TEST_H #include <memory> template <class Type> bool operator==(const std::weak_ptr<Type>& wp1, const std::weak_ptr<Type>& wp2) { std...
Eliott asked 15/4, 2012 at 21:34

2

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...
Mccleary asked 10/12, 2010 at 12:42

1

While I have std::tr1::shared_ptr<T> 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 p...
Interstitial asked 3/2, 2012 at 20:34

6

Solved

Does anyone know if there's a de-facto standard (i.e., TR1 or Boost) C++ function object for accessing the elements of a std::pair? Twice in the past 24 hours I've wished I had something like the k...
Taliesin asked 16/12, 2008 at 21:1

3

Solved

I have a project which I would like to make more use of smart pointers. Overall, I have been successful in this goal. However, I've come across one things which I'm not sure what the "best practice...
Haig asked 10/3, 2009 at 18:21

1

Solved

I read through n1429 with the section The algorithms regex_match and regex_search both support a feature not commonly seen in regular expression libraries: a partial match. When the flag std::re...
Leguminous asked 8/10, 2011 at 9:23

3

For the code I am currently working on, we sometimes need to compile on some older systems with older compilers (e.g.- we run sims on an older IBM BlueGene/L, who's support contract dictates some q...
Exhalation asked 17/8, 2011 at 15:37

7

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 a...
Physiotherapy asked 18/9, 2008 at 2:29

1

As a follow-up to Can tr1::function swallow return values?, how can one work around the limitation that tr1::function cannot swallow return values? This should work in the specific case of swallow...
Plasma asked 11/7, 2011 at 16:45

1

Solved

The boost::function FAQ item 3 specifically addresses the scenario I am interested in: Why are there workarounds for void returns? C++ allows them! Void returns are permitted by the C++ standa...
Vasiliu asked 8/7, 2011 at 17:59

1

Solved

In Perl, I can do this: $text = '1747239'; @matches = ($text =~ m/(\d)/g); # @matches now contains ('1', '7', '4', '7', '2', '3', '9') Using C++ regex matching, what's the best way to replicate ...
Overfill asked 26/5, 2011 at 9:54

3

Solved

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/...
Bautista asked 22/12, 2010 at 16:34

4

Solved

I would like to use the TR1 libraries that ship with modern versions of GCC and MSVC, but there are subtle differences: in GCC, I have to say #include <tr1/memory> std::tr1::shared_ptr<in...
Wrestle asked 10/5, 2011 at 15:34

4

Solved

How do I allow the STL implementation to pick up my custom types? On MSVC, there is a class std::tr1::hash, which I can partially specialize by using namespace std { namespace tr1 { template...
Richburg asked 15/3, 2009 at 15:14

5

Solved

We are programming a logging library that keeps itself in a .hpp file. We would like to include <tr1/unordered_map> (if the compiler supports TR1,) or the standard <map> otherwise. Is t...
Lyndel asked 7/4, 2009 at 7:19

3

Between C++0x, C++03 TR1 and boost some things like function and bind can be defined in 3 different places depending on the compiler, eg for VC pre VC9 feature pack you have the boost versions, the...
Heyde asked 2/3, 2011 at 0:34

2

Solved

I'm using the latest available GCC build from repository. I decided to use it because some additional C++0x features. However now I stuck with something what supposes to work - I want to add new el...
Unexperienced asked 26/1, 2011 at 20:49

4

Solved

I initially thought they're all the same, but it turned out to be wrong. So can anyone briefly explain the differences between these three? For example: std::bind ( newest one, next generation of...
Doggy asked 13/1, 2011 at 17:7

1

Solved

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 wonderin...
Folia asked 10/12, 2010 at 23:33

4

Solved

I'm trying to use the C++ STD TechnicalReport1 extensions to generate numbers following a normal distribution, but this code (adapted from this article): mt19937 eng; eng.seed(SEED); normal_dist...
Undertone asked 13/7, 2009 at 9:33

1

Solved

Boost::Serialization has builtin support for boost::shared_ptr<>. Is there a way to use this support for std::tr1::shared_ptr<> too? Is it possible to cast from std::tr1::shared_ptr&lt...
Susannahsusanne asked 4/11, 2010 at 7:21

2

#include <string> #include <tr1/regex> #include "TextProcessing.h" const std::string URL_PATTERN("((http://)[-a-zA-Z0-9@:%_\\+.~#?&//=]+)"); const std::string REPLACEMENT("<a h...
Wofford asked 20/10, 2010 at 23:31

1

Solved

Are there any difference between tr1::shared_ptr and boost::shared_ptr? If so, what?
Hanfurd asked 30/9, 2010 at 14:31

3

Solved

I'm currently writing a C++ memory editing library and for the read/write APIs I use type traits (std::is_pod, std::is_same) and boost::enable_if to provide 3 overloads: POD types. e.g. MyMem.Rea...
Histochemistry asked 9/9, 2010 at 6:21

1

Solved

Let's say you have a c++0x std::array member of a template class and you want to initialize it by means of a constructor that takes a couple of iterators: template <typename Tp, size_t N&...
Vadose asked 22/7, 2010 at 17:7

© 2022 - 2024 — McMap. All rights reserved.