Search Results

Search found 61 results on 3 pages for 'tr1'.

Page 1/3 | 1 2 3  | Next Page >

  • libstdc++ - compiling failing because of tr1/regex

    - by Radek Šimko
    I have these packages installed on my OpenSUSE 11.3: i | libstdc++45 | Standard shared library for C++ | package i | libstdc++45-devel | Contains files and libraries for development | package But when i'm trying to compile this C++ code: #include <stdio.h> #include <tr1/regex> using namespace std; int main() { int test[2]; const tr1::regex pattern(".*"); test[0] = 1; if (tr1::regex_match("anything", pattern) == false) { printf("Pattern does not match.\n"); } return 0; } using g++ -pedantic -g -O1 -o ./main.o ./main.cpp It outputs this errors: ./main.cpp: In function ‘int main()’: ./main.cpp:13:43: error: ‘printf’ was not declared in this scope radek@mypc:~> nano main.cpp radek@mypc:~> g++ -pedantic -g -O1 -o ./main.o ./main.cpp /tmp/cc0g3GUE.o: In function `basic_regex': /usr/include/c++/4.5/tr1_impl/regex:771: undefined reference to `std::tr1::basic_regex<char, std::tr1::regex_traits<char> >::_M_compile()' /tmp/cc0g3GUE.o: In function `bool std::tr1::regex_match<char const*, char, std::tr1::regex_traits<char> >(char const*, char const*, std::tr1::basic_regex<char, std::tr1::regex_traits<char> > const&, std::bitset<11u>)': /usr/include/c++/4.5/tr1_impl/regex:2144: undefined reference to `bool std::tr1::regex_match<char const*, std::allocator<std::tr1::sub_match<char const*> >, char, std::tr1::regex_traits<char> >(char const*, char const*, std::tr1::match_results<char const*, std::allocator<std::tr1::sub_match<char const*> > >&, std::tr1::basic_regex<char, std::tr1::regex_traits<char> > const&, std::bitset<11u>)' collect2: ld returned 1 exit status What packages should i (un)install to make the code work on my PC?

    Read the article

  • linker error when using tr1::regex

    - by Max
    Hello. I've got a program that uses tr1::regex, and while it compiles, it gives me very verbose linker errors. Here's my header file MapObject.hpp: #include <iostream> #include <string> #include <tr1/regex> #include "phBaseObject.hpp" using std::string; namespace phObject { class MapObject: public phBaseObject { private: string color; // must be a hex string represented as "#XXXXXX" static const std::tr1::regex colorRX; // enforces the rule above public: void setColor(const string&); (...) }; } Here's my implementation: #include <iostream> #include <string> #include <tr1/regex> #include "MapObject.hpp" using namespace std; namespace phObject { const tr1::regex MapObject::colorRX("#[a-fA-F0-9]{6}"); void MapObject::setColor(const string& c) { if(tr1::regex_match(c.begin(), c.end(), colorRX)) { color = c; } else cerr << "Invalid color assignment (" << c << ")" << endl; } (...) } and now for the errors: max@max-desktop:~/Desktop/Development/CppPartyHack/PartyHack/lib$ g++ -Wall -std=c++0x MapObject.cpp /tmp/cce5gojG.o: In function std::tr1::basic_regex<char, std::tr1::regex_traits<char> >::basic_regex(char const*, unsigned int)': MapObject.cpp:(.text._ZNSt3tr111basic_regexIcNS_12regex_traitsIcEEEC1EPKcj[std::tr1::basic_regex<char, std::tr1::regex_traits<char> >::basic_regex(char const*, unsigned int)]+0x61): undefined reference tostd::tr1::basic_regex ::_M_compile()' /tmp/cce5gojG.o: In function bool std::tr1::regex_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, char, std::tr1::regex_traits<char> >(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::tr1::basic_regex<char, std::tr1::regex_traits<char> > const&, std::bitset<11u>)': MapObject.cpp:(.text._ZNSt3tr111regex_matchIN9__gnu_cxx17__normal_iteratorIPKcSsEEcNS_12regex_traitsIcEEEEbT_S8_RKNS_11basic_regexIT0_T1_EESt6bitsetILj11EE[bool std::tr1::regex_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, char, std::tr1::regex_traits<char> >(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::tr1::basic_regex<char, std::tr1::regex_traits<char> > const&, std::bitset<11u>)]+0x53): undefined reference tobool std::tr1::regex_match<__gnu_cxx::__normal_iterator, std::allocator , std::allocator, std::allocator , char, std::tr1::regex_traits (__gnu_cxx::__normal_iterator, std::allocator , __gnu_cxx::__normal_iterator, std::allocator , std::tr1::match_results<__gnu_cxx::__normal_iterator, std::allocator , std::allocator, std::allocator &, std::tr1::basic_regex const&, std::bitset<11u)' collect2: ld returned 1 exit status I can't really make heads or tails of this, except for the undefined reference to std::tr1::basic_regex near the beginning. Anyone know what's going on?

    Read the article

  • Is it worth using std::tr1 in production?

    - by flashnik
    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 unordered_map is just theirs stdext::hash_map, templatized in another way.

    Read the article

  • Why is std::tr1::shared_ptr<>.reset() so expensive?

    - by Paul Oyster
    Profiling some code that heavily uses shared_ptrs, I discovered that reset() was surprisingly expensive. For example: struct Test { int i; Test() { this->i = 0; } Test(int i) { this->i = i; } } ; ... auto t = make_shared<Test>(1); ... t.reset(somePointerToATestObject); Tracing the reset() in the last line (under VC++ 2010), I discovered that it creates a new reference-counting object. Is there a cheaper way, that reuses the existing ref-count and does not bother the heap?

    Read the article

  • Trouble assigning a tr1::shared_ptr

    - by Max
    I've got a class that has a tr1::shared_ptr as a member, like so: class Foo { std::tr1::shared_ptr<TCODBsp> bsp; void Bar(); } In member function Bar, I try to assign it like this: bsp = newTCODBsp(x,y,w,h); g++ then gives me this error no match for ‘operator=’ in ‘((yarl::mapGen::MapGenerator*)this)->yarl::mapGen::MapGenerator::bsp = (operator new(40u), (<statement>, ((TCODBsp*)<anonymous>)))’ /usr/include/c++/4.4/tr1/shared_ptr.h:834: note: candidates are: std::tr1::shared_ptr<TCODBsp>& std::tr1::shared_ptr<TCODBsp>::operator=(const std::tr1::shared_ptr<TCODBsp>&) in my code, Foo is actually yarl::mapGen::MapGenerator. What am I doing wrong?

    Read the article

  • Are tr1 headers available for gcc v3.4.6?

    - by WilliamKF
    Are tr1 headers available for g++ v3.4.6? If so, how can I locate them at compile time. The following is failing to compile: #include <tr1/memory> With the following error: myModule.h:20:24: tr1/memory: No such file or directory Do I need to move to a later compiler or do I have the headers somewhere?

    Read the article

  • On reference_wrapper and callable objects

    - by Nicola Bonelli
    Given the following callable object: struct callable : public std::unary_function &lt;void, void&gt; { void operator()() const { std::cout << "hello world" << std::endl; } }; a std::tr1::reference_wrapper< calls through it: callable obj; std::tr1::ref(obj)(); Instead, when the operator() accepts an argument: struct callable : public std::unary_function &lt;int, void&gt; { void operator()(int n) const { std::cout << n << std::endl; } }; std::tr1::bind accepts a reference_wrapper to it as a callable wrapper... callable obj; std::tr1::bind( std::tr1::ref(obj), 42 )(); but what's wrong with this? std::tr1::ref(obj)(42);

    Read the article

  • Is there any boost-independent version of boost/tr1 shared_ptr

    - by Artyom
    I'm looking for independent implementation of boost/tr1 shared_ptr, weak_ptr and enable_shared_from_this. I need: Boost independent very small implementation of these features. I need support of only modern compilers like GCC-4.x, MSVC-2008, Intel not things like MSVC6 or gcc-3.3 I need it to be licensed under non-copyleft LGPL compatible license like Boost/Mit/3-clause BSD. So I can include it in my library. Note - it is quite hard to extract shared_ptr from boost, at least BCP gives about 324 files...

    Read the article

  • C++: Trouble with tr1::bind (C2065)

    - by Rosarch
    I'm getting a compiler error with bind: using namespace std; bool odp(int arg1, int arg2); // ... find_if(vec.begin(), vec.end(), tr1::bind(odp, iValue, _1)); // C2065 My goal is to curry odp(), so its first argument is iValue, and apply that function in find_if. The error: C2065: '_1' : undeclared identifier. What am I doing wrong?

    Read the article

  • Where to add an overloaded operator for the tr1::array?

    - by phlipsy
    Since I need to add an operator& for the std::tr1::array<bool, N> I wrote the following lines template<std::size_t N> std::tr1::array<bool, N> operator& (const std::tr1::array<bool, N>& a, const std::tr1::array<bool, N>& b) { std::tr1::array<bool, N> result; std::transform(a.begin(), a.end(), b.begin(), result.begin(), std::logical_and<bool>()); return result; } Now I don't know in which namespace I've to put this function. I considered the std namespace as a restricted area. Only total specialization and overloaded function templates are allowed to be added by the user. Putting it into the global namespace isn't "allowed" either in order to prevent pollution of the global namespace and clashes with other declarations. And finally putting this function into the namespace of the project doesn't work since the compiler won't find it there. What had I best do? I don't want to write a new array class putted into the project namespace. Because in this case the compiler would find the right namespace via argument dependent name lookup. Or is this the only possible way because writing a new operator for existing classes means extending their interfaces and this isn't allowed either for standard classes?

    Read the article

  • [C++] Index strings by other strings

    - by mcco
    Hello, I need to index specific strings with other strings and I can't really find a good way to do so. I tried to use tr1::unordered_map, but I'm having some difficulties using it. If someone could tell me what is the best way to do that I'd be really grateful :) I also need to index objects by a number (numbers are not in order so I can't use a vector)

    Read the article

  • Type problem when including tuple

    - by Person
    I'm using Visual Studio 2008 with Feature Pack 1. I have a typedef like this typedef std::tr1::tuple<std::string, std::string, int> tileInfo with a function like this const tileInfo& GetTile( int x, int y ) const. In the implementation file the function has the exact same signature (with the added class name qualifier) and I am getting a redefinition: different type modifiers error. It seems to be looking for an int& instead of a tileInfo& When I mouse over the type of the function in the header, i.e. tileInfo& it brings up a little bar saying static const int tileInfo. I think this may be the problem, but I'm not sure what to do. Any help is appreciated, thanks.

    Read the article

  • Allocation Target of std::aligned_storage (stack or heap?)

    - by Zenikoder
    I've been trying to get my head around the TR1 addition known as aligned_storage. Whilst reading the following documents N2165, N3190 and N2140 I can't for the life of me see a statement where it clearly describes stack or heap nature of the memory being used. I've had a look at the implementation provided by msvc2010, boost and gcc they all provide a stack based solution centered around the use of a union. In short: Is the memory type (stack or heap) used by aligned_storage implementation defined or is it always meant to be stack based? and, What the is the specific document that defines/determines that?

    Read the article

  • Random numbers from binomial distribution

    - by Sarah
    I need to generate quickly lots of random numbers from binomial distributions for dramatically different trial sizes (most, however, will be small). I was hoping not to have to code an algorithm by hand (see, e.g., this related discussion from November), because I'm a novice programmer and don't like reinventing wheels. It appears Boost does not supply a generator for binomially distributed variates, but TR1 and GSL do. Is there a good reason to choose one over the other, or is it better that I write something customized to my situation? I don't know if this makes sense, but I'll alternate between generating numbers from uniform distributions and binomial distributions throughout the program, and I'd like for them to share the same seed and to minimize overhead. I'd love some advice or examples for what I should be considering.

    Read the article

  • Reversing strings in a vector using for_each and bind

    - by fmuecke
    Hi! 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 least I couldn't do it). #include <vector> #include <string> #include <algorithm> std::vector<std::string> v; v.push_back("abc"); v.push_back("12345"); std::for_each(v.begin(), v.end(), /*call std::reverse for each element*/); Edit: Thanks a lot for those funtastic solutions. However, the solution for me was not to use the tr1::bind that comes with the Visual Studio 2008 feature pack/SP1. I don't know why it does not work like expected but that's the way it is (even MS admits that it's buggy). Maybe some hotfixes will help. With boost::bind everything works like desired and is so easy (but sometimes relly messy:)). I really should have tried boost::bind in the first place...

    Read the article

  • Containers of reference_wrappers (comparison operators required?)

    - by kloffy
    If you use stl containers together with reference_wrappers of POD types, the following code works just fine: int i = 3; std::vector< boost::reference_wrapper<int> > is; is.push_back(boost::ref(i)); std::cout << (std::find(is.begin(),is.end(),i)!=is.end()) << std::endl; However, if you use non-POD types such as (contrived example): struct Integer { int value; bool operator==(const Integer& rhs) const { return value==rhs.value; } bool operator!=(const Integer& rhs) const { return !(*this == rhs); } }; It doesn't suffice to declare those comparison operators, instead you have to declare: bool operator==(const boost::reference_wrapper<Integer>& lhs, const Integer& rhs) { return boost::unwrap_ref(lhs)==rhs; } And possibly also: bool operator==(const Integer& lhs, const boost::reference_wrapper<Integer>& rhs) { return lhs==boost::unwrap_ref(rhs); } In order to get the equivalent code to work: Integer j = { 0 }; std::vector< boost::reference_wrapper<Integer> > js; js.push_back(boost::ref(j)); std::cout << (std::find(js.begin(),js.end(),j)!=js.end()) << std::endl; Now, I'm wondering if this is really the way it's meant to be done, since it seems impractical. It just seems there should be a simpler solution, e.g. templates: template<class T> bool operator==(const boost::reference_wrapper<T>& lhs, const T& rhs) { return boost::unwrap_ref(lhs)==rhs; } template<class T> bool operator==(const T& lhs, const boost::reference_wrapper<T>& rhs) { return lhs==boost::unwrap_ref(rhs); } There's probably a good reason why reference_wrapper behaves the way it does (possibly to accomodate non-POD types without comparison operators?). Maybe there already is an elegant solution and I just haven't found it.

    Read the article

  • C++0x, How do I expand a tuple into variadic template function arguments?

    - by Gustaf
    Consider the case of a templated function with variadic template arguments: template<typename Tret, typename... T> Tret func(const T&... t); Now, I have a tuple t of values. How do I call func() using the tuple values as arguments? I've read about the bind() function object, with call() function, and also the apply() function in different some now-obsolete documents. The GNU GCC 4.4 implementation seems to have a call() function in the bind() class, but there is very little documentation on the subject. Some people suggest hand-written recursive hacks, but the true value of variadic template arguments is to be able to use them in cases like above. Does anyone have a solution to is, or hint on where to read about it?

    Read the article

  • Troubleshoot Perl module installation on Mac OS X

    - by Daniel Standage
    I'm trying to install the Perl module Set::IntervalTree on Mac OS X. I recently installed it today on an Ubuntu box with no problem. I simply started cpan, entered install Set:IntervalTree, and it all worked out. However, the installation failed on Mac OS X--it spits out a huge list of compiler errors (below). How would I troubleshoot this. I don't even know where to begin. cpan[1]> install Set::IntervalTree CPAN: Storable loaded ok (v2.18) Going to read /Users/standage/.cpan/Metadata Database was generated on Fri, 14 Jan 2011 02:58:42 GMT CPAN: YAML loaded ok (v0.72) Going to read /Users/standage/.cpan/build/ ............................................................................DONE Found 1 old build, restored the state of 1 Running install for module 'Set::IntervalTree' Running make for B/BE/BENBOOTH/Set-IntervalTree-0.01.tar.gz CPAN: Digest::SHA loaded ok (v5.45) CPAN: Compress::Zlib loaded ok (v2.008) Checksum for /Users/standage/.cpan/sources/authors/id/B/BE/BENBOOTH/Set-IntervalTree-0.01.tar.gz ok Scanning cache /Users/standage/.cpan/build for sizes ............................................................................DONE x Set-IntervalTree-0.01/ x Set-IntervalTree-0.01/src/ x Set-IntervalTree-0.01/src/Makefile x Set-IntervalTree-0.01/src/interval_tree.h x Set-IntervalTree-0.01/src/test_main.cc x Set-IntervalTree-0.01/lib/ x Set-IntervalTree-0.01/lib/Set/ x Set-IntervalTree-0.01/lib/Set/IntervalTree.pm x Set-IntervalTree-0.01/Changes x Set-IntervalTree-0.01/MANIFEST x Set-IntervalTree-0.01/t/ x Set-IntervalTree-0.01/t/Set-IntervalTree.t x Set-IntervalTree-0.01/typemap x Set-IntervalTree-0.01/perlobject.map x Set-IntervalTree-0.01/IntervalTree.xs x Set-IntervalTree-0.01/Makefile.PL x Set-IntervalTree-0.01/README x Set-IntervalTree-0.01/META.yml CPAN: File::Temp loaded ok (v0.18) CPAN.pm: Going to build B/BE/BENBOOTH/Set-IntervalTree-0.01.tar.gz Checking if your kit is complete... Looks good Writing Makefile for Set::IntervalTree cp lib/Set/IntervalTree.pm blib/lib/Set/IntervalTree.pm AutoSplitting blib/lib/Set/IntervalTree.pm (blib/lib/auto/Set/IntervalTree) /usr/bin/perl /System/Library/Perl/5.10.0/ExtUtils/xsubpp -C++ -typemap /System/Library/Perl/5.10.0/ExtUtils/typemap -typemap perlobject.map -typemap typemap IntervalTree.xs > IntervalTree.xsc && mv IntervalTree.xsc IntervalTree.c g++ -c -Isrc -arch x86_64 -arch i386 -arch ppc -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -I/usr/local/include -g -O0 -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" "-I/System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE" -Isrc IntervalTree.c In file included from /usr/include/c++/4.2.1/bits/basic_ios.h:44, from /usr/include/c++/4.2.1/ios:50, from /usr/include/c++/4.2.1/ostream:45, from /usr/include/c++/4.2.1/iostream:45, from IntervalTree.xs:16: /usr/include/c++/4.2.1/bits/locale_facets.h:4420:40: error: macro "do_open" requires 7 arguments, but only 2 given /usr/include/c++/4.2.1/bits/locale_facets.h:4467:34: error: macro "do_close" requires 2 arguments, but only 1 given /usr/include/c++/4.2.1/bits/locale_facets.h:4486:55: error: macro "do_open" requires 7 arguments, but only 2 given /usr/include/c++/4.2.1/bits/locale_facets.h:4513:23: error: macro "do_close" requires 2 arguments, but only 1 given In file included from /usr/include/c++/4.2.1/bits/locale_facets.h:4599, from /usr/include/c++/4.2.1/bits/basic_ios.h:44, from /usr/include/c++/4.2.1/ios:50, from /usr/include/c++/4.2.1/ostream:45, from /usr/include/c++/4.2.1/iostream:45, from IntervalTree.xs:16: /usr/include/c++/4.2.1/i686-apple-darwin10/x86_64/bits/messages_members.h:58:38: error: macro "do_open" requires 7 arguments, but only 2 given /usr/include/c++/4.2.1/i686-apple-darwin10/x86_64/bits/messages_members.h:67:71: error: macro "do_open" requires 7 arguments, but only 2 given /usr/include/c++/4.2.1/i686-apple-darwin10/x86_64/bits/messages_members.h:78:39: error: macro "do_close" requires 2 arguments, but only 1 given In file included from /usr/include/c++/4.2.1/bits/basic_ios.h:44, from /usr/include/c++/4.2.1/ios:50, from /usr/include/c++/4.2.1/ostream:45, from /usr/include/c++/4.2.1/iostream:45, from IntervalTree.xs:16: /usr/include/c++/4.2.1/bits/locale_facets.h:4486: error: ‘do_open’ declared as a ‘virtual’ field /usr/include/c++/4.2.1/bits/locale_facets.h:4486: error: expected ‘;’ before ‘const’ /usr/include/c++/4.2.1/bits/locale_facets.h:4513: error: variable or field ‘do_close’ declared void /usr/include/c++/4.2.1/bits/locale_facets.h:4513: error: expected ‘;’ before ‘const’ In file included from /usr/include/c++/4.2.1/bits/locale_facets.h:4599, from /usr/include/c++/4.2.1/bits/basic_ios.h:44, from /usr/include/c++/4.2.1/ios:50, from /usr/include/c++/4.2.1/ostream:45, from /usr/include/c++/4.2.1/iostream:45, from IntervalTree.xs:16: /usr/include/c++/4.2.1/i686-apple-darwin10/x86_64/bits/messages_members.h:67: error: expected initializer before ‘const’ /usr/include/c++/4.2.1/i686-apple-darwin10/x86_64/bits/messages_members.h:78: error: expected initializer before ‘const’ In file included from IntervalTree.xs:19: src/interval_tree.h:95: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _Tp, class _Alloc> class std::vector’ src/interval_tree.h:95: error: expected a type, got ‘IntervalTree<T,N>::it_recursion_node’ src/interval_tree.h:95: error: template argument 2 is invalid src/interval_tree.h: In constructor ‘IntervalTree<T, N>::IntervalTree()’: src/interval_tree.h:130: error: expected type-specifier src/interval_tree.h:130: error: expected `;' src/interval_tree.h:135: error: expected type-specifier src/interval_tree.h:135: error: expected `;' src/interval_tree.h:141: error: request for member ‘push_back’ in ‘((IntervalTree<T, N>*)this)->IntervalTree<T, N>::recursionNodeStack’, which is of non-class type ‘int’ src/interval_tree.h: In member function ‘void IntervalTree<T, N>::LeftRotate(IntervalTree<T, N>::Node*)’: src/interval_tree.h:178: error: ‘y’ was not declared in this scope src/interval_tree.h: In member function ‘void IntervalTree<T, N>::RightRotate(IntervalTree<T, N>::Node*)’: src/interval_tree.h:240: error: ‘x’ was not declared in this scope src/interval_tree.h: In member function ‘void IntervalTree<T, N>::TreeInsertHelp(IntervalTree<T, N>::Node*)’: src/interval_tree.h:298: error: ‘x’ was not declared in this scope src/interval_tree.h:299: error: ‘y’ was not declared in this scope src/interval_tree.h: In member function ‘typename IntervalTree<T, N>::Node* IntervalTree<T, N>::insert(const T&, N, N)’: src/interval_tree.h:375: error: ‘y’ was not declared in this scope src/interval_tree.h:376: error: ‘x’ was not declared in this scope src/interval_tree.h:377: error: ‘newNode’ was not declared in this scope src/interval_tree.h:379: error: expected type-specifier src/interval_tree.h:379: error: expected `;' src/interval_tree.h: In member function ‘typename IntervalTree<T, N>::Node* IntervalTree<T, N>::GetSuccessorOf(IntervalTree<T, N>::Node*) const’: src/interval_tree.h:450: error: ‘y’ was not declared in this scope src/interval_tree.h: In member function ‘typename IntervalTree<T, N>::Node* IntervalTree<T, N>::GetPredecessorOf(IntervalTree<T, N>::Node*) const’: src/interval_tree.h:483: error: ‘y’ was not declared in this scope src/interval_tree.h: In destructor ‘IntervalTree<T, N>::~IntervalTree()’: src/interval_tree.h:546: error: ‘x’ was not declared in this scope src/interval_tree.h:547: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _Tp, class _Alloc> class std::vector’ src/interval_tree.h:547: error: expected a type, got ‘(IntervalTree<T,N>::Node * <expression error>)’ src/interval_tree.h:547: error: template argument 2 is invalid src/interval_tree.h:547: error: invalid type in declaration before ‘;’ token src/interval_tree.h:551: error: request for member ‘push_back’ in ‘stuffToFree’, which is of non-class type ‘int’ src/interval_tree.h:554: error: request for member ‘push_back’ in ‘stuffToFree’, which is of non-class type ‘int’ src/interval_tree.h:557: error: request for member ‘empty’ in ‘stuffToFree’, which is of non-class type ‘int’ src/interval_tree.h:558: error: request for member ‘back’ in ‘stuffToFree’, which is of non-class type ‘int’ src/interval_tree.h:559: error: request for member ‘pop_back’ in ‘stuffToFree’, which is of non-class type ‘int’ src/interval_tree.h:561: error: request for member ‘push_back’ in ‘stuffToFree’, which is of non-class type ‘int’ src/interval_tree.h:564: error: request for member ‘push_back’ in ‘stuffToFree’, which is of non-class type ‘int’ src/interval_tree.h: In member function ‘void IntervalTree<T, N>::DeleteFixUp(IntervalTree<T, N>::Node*)’: src/interval_tree.h:613: error: ‘w’ was not declared in this scope src/interval_tree.h:614: error: ‘rootLeft’ was not declared in this scope src/interval_tree.h: In member function ‘T IntervalTree<T, N>::remove(IntervalTree<T, N>::Node*)’: src/interval_tree.h:697: error: ‘y’ was not declared in this scope src/interval_tree.h:698: error: ‘x’ was not declared in this scope src/interval_tree.h: In member function ‘std::vector<T, std::allocator<_CharT> > IntervalTree<T, N>::fetch(N, N)’: src/interval_tree.h:819: error: ‘x’ was not declared in this scope src/interval_tree.h:833: error: invalid types ‘int[size_t]’ for array subscript src/interval_tree.h:836: error: request for member ‘push_back’ in ‘((IntervalTree<T, N>*)this)->IntervalTree<T, N>::recursionNodeStack’, which is of non-class type ‘int’ src/interval_tree.h:837: error: request for member ‘back’ in ‘((IntervalTree<T, N>*)this)->IntervalTree<T, N>::recursionNodeStack’, which is of non-class type ‘int’ src/interval_tree.h:838: error: request for member ‘back’ in ‘((IntervalTree<T, N>*)this)->IntervalTree<T, N>::recursionNodeStack’, which is of non-class type ‘int’ src/interval_tree.h:839: error: request for member ‘back’ in ‘((IntervalTree<T, N>*)this)->IntervalTree<T, N>::recursionNodeStack’, which is of non-class type ‘int’ src/interval_tree.h:840: error: request for member ‘size’ in ‘((IntervalTree<T, N>*)this)->IntervalTree<T, N>::recursionNodeStack’, which is of non-class type ‘int’ src/interval_tree.h:846: error: request for member ‘size’ in ‘((IntervalTree<T, N>*)this)->IntervalTree<T, N>::recursionNodeStack’, which is of non-class type ‘int’ src/interval_tree.h:847: error: expected `;' before ‘back’ src/interval_tree.h:848: error: request for member ‘pop_back’ in ‘((IntervalTree<T, N>*)this)->IntervalTree<T, N>::recursionNodeStack’, which is of non-class type ‘int’ src/interval_tree.h:850: error: ‘back’ was not declared in this scope src/interval_tree.h:853: error: invalid types ‘int[size_t]’ for array subscript IntervalTree.c: In function ‘void boot_Set__IntervalTree(PerlInterpreter*, CV*)’: IntervalTree.c:365: warning: deprecated conversion from string constant to ‘char*’ src/interval_tree.h: In constructor ‘IntervalTree<T, N>::IntervalTree() [with T = std::tr1::shared_ptr<sv>, N = long int]’: IntervalTree.c:67: instantiated from here src/interval_tree.h:130: error: cannot convert ‘int*’ to ‘IntervalTree<std::tr1::shared_ptr<sv>, long int>::Node*’ in assignment src/interval_tree.h:135: error: cannot convert ‘int*’ to ‘IntervalTree<std::tr1::shared_ptr<sv>, long int>::Node*’ in assignment ...blah blah blah... ...blah blah blah... ...blah blah blah... ...blah blah blah... ...blah blah blah... ...blah blah blah... src/interval_tree.h:848: error: request for member ‘pop_back’ in ‘((IntervalTree<T, N>*)this)->IntervalTree<T, N>::recursionNodeStack’, which is of non-class type ‘int’ src/interval_tree.h:850: error: ‘back’ was not declared in this scope src/interval_tree.h:853: error: invalid types ‘int[size_t]’ for array subscript IntervalTree.c: In function ‘void boot_Set__IntervalTree(PerlInterpreter*, CV*)’: IntervalTree.c:365: warning: deprecated conversion from string constant to ‘char*’ src/interval_tree.h: In constructor ‘IntervalTree<T, N>::IntervalTree() [with T = std::tr1::shared_ptr<sv>, N = long int]’: IntervalTree.c:67: instantiated from here src/interval_tree.h:130: error: cannot convert ‘int*’ to ‘IntervalTree<std::tr1::shared_ptr<sv>, long int>::Node*’ in assignment src/interval_tree.h:135: error: cannot convert ‘int*’ to ‘IntervalTree<std::tr1::shared_ptr<sv>, long int>::Node*’ in assignment src/interval_tree.h: In member function ‘typename IntervalTree<T, N>::Node* IntervalTree<T, N>::insert(const T&, N, N) [with T = std::tr1::shared_ptr<sv>, N = long int]’: IntervalTree.xs:57: instantiated from here src/interval_tree.h:375: error: dependent-name ‘IntervalTree<T,N>::Node’ is parsed as a non-type, but instantiation yields a type src/interval_tree.h:375: note: say ‘typename IntervalTree<T,N>::Node’ if a type is meant src/interval_tree.h:376: error: dependent-name ‘IntervalTree<T,N>::Node’ is parsed as a non-type, but instantiation yields a type src/interval_tree.h:376: note: say ‘typename IntervalTree<T,N>::Node’ if a type is meant src/interval_tree.h:377: error: dependent-name ‘IntervalTree<T,N>::Node’ is parsed as a non-type, but instantiation yields a type src/interval_tree.h:377: note: say ‘typename IntervalTree<T,N>::Node’ if a type is meant src/interval_tree.h: In member function ‘std::vector<T, std::allocator<_CharT> > IntervalTree<T, N>::fetch(N, N) [with T = std::tr1::shared_ptr<sv>, N = long int]’: IntervalTree.xs:65: instantiated from here src/interval_tree.h:819: error: dependent-name ‘IntervalTree<T,N>::Node’ is parsed as a non-type, but instantiation yields a type src/interval_tree.h:819: note: say ‘typename IntervalTree<T,N>::Node’ if a type is meant IntervalTree.xs:65: instantiated from here src/interval_tree.h:847: error: dependent-name ‘IntervalTree<T,N>::it_recursion_node’ is parsed as a non-type, but instantiation yields a type src/interval_tree.h:847: note: say ‘typename IntervalTree<T,N>::it_recursion_node’ if a type is meant src/interval_tree.h: In destructor ‘IntervalTree<T, N>::~IntervalTree() [with T = std::tr1::shared_ptr<sv>, N = long int]’: IntervalTree.c:205: instantiated from here src/interval_tree.h:546: error: dependent-name ‘IntervalTree<T,N>::Node’ is parsed as a non-type, but instantiation yields a type src/interval_tree.h:546: note: say ‘typename IntervalTree<T,N>::Node’ if a type is meant src/interval_tree.h: In member function ‘void IntervalTree<T, N>::TreeInsertHelp(IntervalTree<T, N>::Node*) [with T = std::tr1::shared_ptr<sv>, N = long int]’: src/interval_tree.h:380: instantiated from ‘typename IntervalTree<T, N>::Node* IntervalTree<T, N>::insert(const T&, N, N) [with T = std::tr1::shared_ptr<sv>, N = long int]’ IntervalTree.xs:57: instantiated from here src/interval_tree.h:298: error: dependent-name ‘IntervalTree<T,N>::Node’ is parsed as a non-type, but instantiation yields a type src/interval_tree.h:298: note: say ‘typename IntervalTree<T,N>::Node’ if a type is meant src/interval_tree.h:299: error: dependent-name ‘IntervalTree<T,N>::Node’ is parsed as a non-type, but instantiation yields a type src/interval_tree.h:299: note: say ‘typename IntervalTree<T,N>::Node’ if a type is meant src/interval_tree.h: In member function ‘void IntervalTree<T, N>::LeftRotate(IntervalTree<T, N>::Node*) [with T = std::tr1::shared_ptr<sv>, N = long int]’: src/interval_tree.h:395: instantiated from ‘typename IntervalTree<T, N>::Node* IntervalTree<T, N>::insert(const T&, N, N) [with T = std::tr1::shared_ptr<sv>, N = long int]’ IntervalTree.xs:57: instantiated from here src/interval_tree.h:178: error: dependent-name ‘IntervalTree<T,N>::Node’ is parsed as a non-type, but instantiation yields a type src/interval_tree.h:178: note: say ‘typename IntervalTree<T,N>::Node’ if a type is meant src/interval_tree.h: In member function ‘void IntervalTree<T, N>::RightRotate(IntervalTree<T, N>::Node*) [with T = std::tr1::shared_ptr<sv>, N = long int]’: src/interval_tree.h:399: instantiated from ‘typename IntervalTree<T, N>::Node* IntervalTree<T, N>::insert(const T&, N, N) [with T = std::tr1::shared_ptr<sv>, N = long int]’ IntervalTree.xs:57: instantiated from here src/interval_tree.h:240: error: dependent-name ‘IntervalTree<T,N>::Node’ is parsed as a non-type, but instantiation yields a type src/interval_tree.h:240: note: say ‘typename IntervalTree<T,N>::Node’ if a type is meant lipo: can't open input file: /var/tmp//ccLthuaw.out (No such file or directory) make: *** [IntervalTree.o] Error 1 BENBOOTH/Set-IntervalTree-0.01.tar.gz make -- NOT OK Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible Failed during this command: BENBOOTH/Set-IntervalTree-0.01.tar.gz : make NO

    Read the article

  • How to use autoconf with C++0x features

    - by themis
    What are the best practices for using autoconf in conjunction with shared_ptr and other TR1/BOOST C++0x templates so as to maximize portability and maintainability? With autoconf I can determine whether shared_ptr is available as std::tr1::shared_ptr and/or boost::shared_ptr. Given that the same feature has two different names, I have the following questions: In the code, how should shared_ptr be referenced? Should std::tr1::shared_ptr be preferred over boost::shared_ptr? For the first, the code is currently using preprocessor conditionals allowing non-qualified references to shared_ptr, a la #if HAVE_STD_TR1_SHARED_PTR using std::tr1::shared_ptr; #elif HAVE_BOOST_SHARED_PTR using boost::shared_ptr; #else #error "No definition for shared_ptr found" #endif Second, the code uses std::tr1:: over boost:: to minimize dependencies on external libraries (even if the the libraries are widely used). Are these two solutions common? Are there better ones?

    Read the article

  • Why does Visual Studio 2010 throw this error with Boost 1.42.0?

    - by ra170
    I'm trying to recompile application, that compiles fine with warning level 4 in visual studio 2005 and visual studio 2008. Since the errors (look below) are coming from std:tr1, I'm thinking there's some conflict, but not sure how to fix. My first thought was to remove all references to boost, such as but then I get an error that it can't find format method. So here's one of the errors: (not sure what it means) Any ideas, suggestions, solutions? Thanks! > c:\program files (x86)\microsoft > visual studio > 10.0\vc\include\type_traits(197): error C2752: > 'std::tr1::_Remove_reference<_Ty>' : > more than one partial specialization > matches the template argument list 1> > with 1> [ 1> > _Ty=bool (__cdecl &)(const BlahBlah &) 1> ] 1> c:\program > files (x86)\microsoft visual studio > 10.0\vc\include\xtr1common(356): could be > 'std::tr1::_Remove_reference<_Ty&&>' > 1> c:\program files > (x86)\microsoft visual studio > 10.0\vc\include\xtr1common(350): or 'std::tr1::_Remove_reference<_Ty&>' 1> > c:\program files (x86)\microsoft > visual studio > 10.0\vc\include\type_traits(962) : see reference to class template > instantiation > 'std::tr1::remove_reference<_Ty>' > being compiled 1> with

    Read the article

  • The cost of passing by shared_ptr

    - by Artem
    I use std::tr1::shared_ptr extensively throughout my application. This includes passing objects in as function arguments. Consider the following: class Dataset {...} void f( shared_ptr< Dataset const > pds ) {...} void g( shared_ptr< Dataset const > pds ) {...} ... While passing a dataset object around via shared_ptr guarantees its existence inside f and g, the functions may be called millions of times, which causes a lot of shared_ptr objects being created and destroyed. Here's a snippet of the flat gprof profile from a recent run: Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls s/call s/call name 9.74 295.39 35.12 2451177304 0.00 0.00 std::tr1::__shared_count::__shared_count(std::tr1::__shared_count const&) 8.03 324.34 28.95 2451252116 0.00 0.00 std::tr1::__shared_count::~__shared_count() So, ~17% of the runtime was spent on reference counting with shared_ptr objects. Is this normal? A large portion of my application is single-threaded and I was thinking about re-writing some of the functions as void f( const Dataset& ds ) {...} and replacing the calls shared_ptr< Dataset > pds( new Dataset(...) ); f( pds ); with f( *pds ); in places where I know for sure the object will not get destroyed while the flow of the program is inside f(). But before I run off to change a bunch of function signatures / calls, I wanted to know what the typical performance hit of passing by shared_ptr was. Seems like shared_ptr should not be used for functions that get called very often. Any input would be appreciated. Thanks for reading. -Artem

    Read the article

  • GNU C++ how to check when -std=c++0x is in effect?

    - by TerryP
    My system compiler (gcc42) works fine with the TR1 features that I want, but trying to support newer compiler versions other than the systems, trying to accessing TR1 headers an #error demanding the -std=c++0x option because of how it interfaces with library or some hub bub like that. /usr/local/lib/gcc45/include/c++/bits/c++0x_warning.h:31:2: error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options. Having to supply an extra switch is no problem, to support GCC 4.4 and 4.5 under this system (FreeBSD), but obviously it changes the picture! Using my system compiler (g++ 4.2 default dialect): #include <tr1/foo> using std::tr1::foo; Using newer (4.5) versions of the compiler with -std=c++0x: #include <foo> using std::foo; Is there anyway using the pre processor, that I can tell if g++ is running with C++0x features enabled? Something like this is what I'm looking for: #ifdef __CXX0X_MODE__ #endif but I have not found anything in the manual or off the web. At this rate, I'm starting to think that life would just be easier, to use Boost as a dependency, and not worry about a new language standard arriving before TR4... hehe.

    Read the article

  • Changing the innerHTML of elements in a nested div tag..

    - by PoorCoder
    -- Representative code only - I need to know how to change the innerhtml of the tablerow -- <html> <head> <script> //full javascript declaration - function call after page loads.. function () { document.getElementById('tr1').innerHTML='<td>Test</td>'; // does not work.. document.getElementByTagNames('tr')[0].innerHTML='<td>Test</td>'; // does not work.. document.getElementById('div2').getElementsByTagNames('tr')[0].innerHTML='<td>Test</td>'; //does not work.. document.getElementById('div1').div2.tr1.innerHTML='<td>Test</td>'; //nope } </script> </head> <body> <div id='div1'> <div id='div2'> <table> <tr id='tr1'></tr> </table> </div> </div> </body> </html> Thanks for the help

    Read the article

  • calling perl script from mysql trigger

    - by Bahareh
    I want to call a perl script inside a mysql after insert trigger. but my trigger does not work.I find this solution from google. here is my code: DROP TRIGGER IF EXISTS 'tr1'// CREATE TRIGGER 'tr1' AFTER INSERT ON 'username' FOR EACH ROW begin SET @result=sys_exec(CONCAT('/usr/bin/perl /etc/p1.pl')); end // and my p1.pl code: #!/usr/bin/perl open(MYFILE,'>>/etc/data.txt'); print MYFILE "BOB\n"; close MYFILE; thanks.

    Read the article

1 2 3  | Next Page >