Quantcast








     

Question on boost::shared_ptr

gamedev.net - 2012-11-01 15:36:21 - Similar - Report/Block

Hi, I'm a beginner about boost. And i try to write some code like: #include "stdafx.h" #include class A; class B; class A public: A() {}; boost::shared_ptr a; boost::shared_ptr b; class B public: B(){}; boost::shared_ptr a; boost::shared_ptr b; int _tmain(int argc, _TCHAR* argv[]) A a; B b; a.a=boost::shared_ptr(&b); a.b=boost::shared_ptr...

Conditional boost::shared_ptr initialization?

stackoverflow.com - 2012-08-03 01:45:03 - Similar - Report/Block

In an effort to write better code, I've committed to using boost's smart pointers. Should a boost::shared_ptr always be initialized like so? boost::shared_ptr<TypeX> px(new TypeX); My confusion has risen from a code block similar to this: void MyClass::FillVector() boost::shared_ptr<TypeX> tempX; if(//Condition a) { boost...

Purpose of const boost::shared_ptr & as function argument?

stackoverflow.com - 2012-05-05 04:09:12 - Similar - Report/Block

I'm using a certain large and well-maintained open-source C++ library and came across a class definition having a constructor of the form class SomeClass { SomeClass( const boost::shared_ptr<SomeOtherClass>& amp; ); My question is: what's the point of passing a const boost::shared_ptr<T> by reference? Is there really a non-ne...

implicit instantiation of undefined template: Boost Bug or Clang Bug?

stackoverflow.com - 2012-03-06 01:13:38 - Similar - Report/Block

I was trying to compile some code that uses Boost (1.49), with Clang(& libc++) from trunk. The problematic code boils down to the following: #include <memory> #include <boost/signals2.hpp> int main() std::shared_ptr<int> s; When compiled with Clang, the following message is emmited: $ clang++ -I/home/alexander/us...

Library for saving c++ objects to database

stackoverflow.com - 2012-03-19 09:46:26 - Similar - Report/Block

I am currently saving my object graph in xml file with boost serialization. The library is great, it automatically restores the objects and all member pointers and references. Problem : I need to have random access to the data ( read just one object, or delete just one object ). With boost serialization the scenario is like this : --load...

Container of shared_ptr's but iterate with raw pointers

stackoverflow.com - 2012-04-05 22:38:58 - Similar - Report/Block

I have a class that holds a list containing boost::shared_ptrs to objects of another class. The class member functions that give access to the elemets in the list return raw pointers. For consistency I'd also like to be able to iterate with raw pointers instead of shared_ptrs. So when I dereference the list iterator, I'd like to get raw...

g++: Use ZIP files as input

stackoverflow.com - 2012-06-15 15:20:43 - Similar - Report/Block

We have the Boost library in our side. It consists of huge amount of files which are not changing ever and only a tiny portion of it is used. We swap the whole boost directory if we are changing versions. Currently we have the Boost sources in our SVN, file by file which makes the checkout operations very slow, especially on Windows. It w...

Undefined reference to boost::timer::auto_cpu_timer

stackoverflow.com - 2012-05-12 17:41:49 - Similar - Report/Block

I try to compile small .cpp file with boost library on remote server on Debian using g++ 4.4. I use Netbeans for this purpose. My home machine is on windows 7. After resolving some issues with linking next code #include <boost/timer/timer.hpp> #include <iostream> #include <string> int main() boost::timer::auto_cpu_timer...

std::vector of objects with a boost::thread encapsulated insde

stackoverflow.com - 2012-02-23 05:52:33 - Similar - Report/Block

How do I create a std::vector of objects, and each object has a boost::thread encapsulated inside. class INSTRUMENT { public: INSTRUMENT() : m_thread(new boost::thread(&INSTRUMENT::Start, this)) { x = "abc"; } ~INSTRUMENT() {} void Start(); public: std::string x; boost::shared_ptr<boost::thread>.. .

C++ smart pointers polymophism

stackoverflow.com - 2013-05-13 13:41:43 - Similar - Report/Block

I am quite new to smart pointer so sorry if my question seems naive to some of you. Here is an example of what i want to do: using namespace std; class Base protected: int m_Property; public: virtual function() {...;} class DerivedA : public Base public: virtual function() {second implementation...;} virtual functionA() {...;} class D...

Adding Boost 1.53.0 to Code::Blocks

gamedev.net - 2013-02-10 03:58:25 - Similar - Report/Block

I've been trying to get boost libraries to work with code::blocks(mingw), but I can't seem to get it right. I have followed the instructions on official website: http://www.boost.org/doc/libs/1_53_0/mor e/getting_started/windows.html#link-your -program-to-a-boost-library I built the libs and everything and added the include and lib to my co...

C++ instantiation of function template with shared_ptrs [closed]

stackoverflow.com - 2012-03-19 19:54:21 - Similar - Report/Block

Possible Duplicate: C++ passing a derived class shared_ptr to a templated function The compiler has no problems with instantiation when we use pointers. template <typename T> struct Base{ virtual ~Base() {} template <typename T> struct Der: public Base<T> { template <class T> void f(Base<T>* b) {} int main(...

evolveStar Join

access multi-index container in without iterator

stackoverflow.com - 2012-03-27 04:26:08 - Similar - Report/Block

sorry if this is a newB question, please conider the following code: #include <boost/multi_index_container.hpp> #include <boost/multi_index/identity.hpp> #include <boost/multi_index/ordered_index.hpp& gt; #include <boost/multi_index/sequenced_index.hp p> #include <boost/tokenizer.hpp> #include <algorithm> #i...

Can you use boost::reference_wrapper to store references in an STL container?

stackoverflow.com - 2012-04-22 22:51:43 - Similar - Report/Block

I am trying to do this: maitain two vectors of strings whereby one vector stores values and the second stores references of the same values. I thought using boost::reference_wrapper would do the trick but it seems it won't. My platform is Visual C++ 2009 std::vector<std::string> str_vec; str_vec.push_back("abc"); str_vec.push_back(...

boost serialization polymorphic issues

stackoverflow.com - 2012-04-30 07:05:12 - Similar - Report/Block

Boost serialization of polymorphic classes seems not working ( 1.40+ boost), e.g. with the following code, I believe I followed the rule: of exporting the class and I tried on both gcc4.4 (ubuntu) and windows VS2010(with boost 1.48): in following program, I expect both 10 and 100 are printed, but it only print 10, that means it only seria...

Boost Fusion compile failure when number of arguments to BOOST_FUSION_ADAPT_STRUCT is 1

stackoverflow.com - 2012-04-01 23:53:48 - Similar - Report/Block

Why does this fail to compile with g++ -c filename.cpp: #include <boost/config/warning_disable.hpp> #include <boost/spirit/include/qi.hpp> #include <boost/spirit/include/phoenix_core.hp p> #include <boost/spirit/include/phoenix_operato r.hpp> #include <boost/spirit/include/phoenix_object. hpp> #include <boost...

Question - Trying to decide between Boost and Virgin Mobile

howardforums.com - 2013-06-12 00:12:49 - Similar - Report/Block

Hi Everyone, I am one of the many people who are excited about the Galaxy S 3 moving to Boost Mobile and Virgin Mobile on the June 12th. As of June 28th, I will be freed from the chains of Verizon, and will be a prepaid customer. But, I am not sure which service to go with, Virgin Mobile or Boost Mobile. I know this is a Boost Mobile foru...

boost::asio::buffer: Getting the buffer size and preventing buffer overflow?

stackoverflow.com - 2013-02-25 05:26:01 - Similar - Report/Block

I have the two following functions for sending and receiving packets. void send(std::string protocol) char *request=new char[protocol.size()+1]; request[protocol.size()] = 0; memcpy(request,protocol.c_str(),protocol .size()); request_length = std::strlen(request); boost::asio::write(s, boost::asio::buffer(request, request_length)); v...

Solr Index time boosting VS Query time boosting?

stackoverflow.com - 2012-05-10 09:16:50 - Similar - Report/Block

Question 1: Can we do Query time boosting(with dismax) only without mentioning boost values at Index time? Question 2: What are the advantages/disadvantages of doing Index time boost over Query time boost and vice versa. Query-time and index-time boosting: At index-time, you have the option to boost a particular document (entirely or just...

using boost thread only works half way

stackoverflow.com - 2012-02-21 14:08:40 - Similar - Report/Block

I just installed Boost on my machine. I'm working with the Visual Studio 2010 Ultimate. To install Boost I followed the instruction here: http://www.boost.org/doc/libs/1_48_0/mor e/getting_started/windows.html . In particular this line: "The installers supplied by BoostPro Computing will download and install pre-compiled binaries into the...

Boost.Iterator Facade with an incomplete Value argument

stackoverflow.com - 2012-02-29 13:00:14 - Similar - Report/Block

I'm trying to use boost::iterator_facade with an incomplete Value template argument. This fails, because iterator_facade is trying to check if the type is_pod Is this the expected behavior? Can I work around this limitation in some way? I could write a class template that simply proxies provides implicit conversion to it, but I'd rather...

C++ polymorphism with boost scoped_ptr

stackoverflow.com - 2012-03-23 20:44:53 - Similar - Report/Block

Why does the following code not allow foo(ptr) to be called ? #include <boost/scoped_ptr.hpp> struct A { virtual ~A() {} struct B: public A {}; void foo(boost::scoped_ptr<A>& a) {} void goo(A& a) {} int main() { boost::scoped_ptr<B> ptr(new B); foo(ptr); B b; goo(b); The corresponding form whe...

Golf Beginner Guide Review

sbwire.com - 2013-03-25 10:15:00 - Similar - Report/Block

The Golf Beginner guide has been planned for those people that wish to learn the game of Golf quickly and efficiently. In The Golf Beginner guide, several teaching professionals have put together the most comprehensive Golfing Guide available for Beginner Golfers.

GUI File Writing & Reading Help

codecall.net - 2013-04-20 23:51:35 - Similar - Report/Block

Howdy! I'm fairly new with Java and I'm having some issues with reading and writing to CSV files. What I initially want to do is write data entered by a user via GUI and it's then written into a single CSV file. Code for this is try { FileWriter fw = new FileWriter("Patients.csv",true); PrintWriter pw = new PrintWriter(fw); //Write to...

Getting the ID of a boost::thread for PostThreadMessage

stackoverflow.com - 2012-02-27 23:57:27 - Similar - Report/Block

I have a Visual Studio 2008 C++ project using Boost 1.47.0 where I need to get the native Windows ID of a boost::thread to pass to PostThreadMessage. In Windows Vista and 7, I would just do this: DWORD thread_id = ::GetThreadId( mythread.native_handle() ); This is fine, but I also need my app to work in XP where GetThreadId does not exis...

Getting the coordinates of points from a Boost Geometry polygon

stackoverflow.com - 2011-10-11 08:20:28 - Similar - Report/Block

I have a simple DLL doing some calculations with Boost Geometry polygons. (Mostly intersections and differences.) Since the DLL will be most likely called from C# code, and from Delphi and who knows from where else, I should convert the result into arrays that everything can handle. UPDATE: I had simplified and somewhat corrected my code.

strange mingw linker errors with boost?

stackoverflow.com - 2011-07-12 04:45:25 - Similar - Report/Block

I've been working on this for a while now, and can't seem to make sense of the situation - partly bceause I don't fully understand what's going on (which is why I came here). I'm doing a sort of boost hello world as follows: #include <boost/thread/thread.hpp> #include <cstdio> void helloworld() { std::printf("HELLO FROM A...

C++: Throwing shared_ptr of derived and catching shared_ptr of base?

stackoverflow.com - 2012-03-30 11:15:48 - Similar - Report/Block

Ok, I've been told this problem: Why can you throw a pointer to a derived class and catch a pointer to its base... but you can't do that with shared_ptrs? Example, this works: class Base {}; class Derived : public Base {}; int main() try { throw new Derived() ; } catch( const Base2 * b ) { printf(...

boost filesystem difficulties

stackoverflow.com - 2012-05-06 16:38:38 - Similar - Report/Block

Hi I'm trying to use boost filesystem and am running into trouble when compiling. Below is the message from the console. I'm using boost 4.9 on OpenSuse 11.4 in eclipse. I have no idea what to try next to get this working so any help would be massively appreciated. Thanks. Invoking: GCC C++ Linker g++ -L/usr/include/CGAL -L/usr/include/bo...

how to write a query on an association with conditions

stackoverflow.com - 2013-05-01 15:24:39 - Similar - Report/Block

I'm wondering if you can help me write a scope method for Rails that I'm having a little trouble completing. I have an app where users can ask questions. The questions are classified according to both categories and tags i.e. Question.rb has_many :categories Question.rb has_many :tags When I show a question, I want to have a feature that...

Boost timer doesn't compile

stackoverflow.com - 2012-04-06 15:56:10 - Similar - Report/Block

I'm trying to compile the boost timer and it's throwing errors I don't understand. It makes me think the timer library is broken atm: #include <string> #include <boost/lexical_cast.hpp> #include <boost/timer/timer.hpp> int main(int argc, char **argv) { // auto_cpu_timer t; std::cout << boost::lexical_cast<s...

ICU vs Boost Locale in C++

stackoverflow.com - 2012-02-29 07:15:12 - Similar - Report/Block

I'm considering using ICU or Boost Locale. What are the pros and cons of each? I understand both use ICU, but ICU is hidden by Boost Locale. According to Boost Locale's rationale page : "...the entire ICU API is hidden behind opaque pointers and users have no access to it." Please consider new Unicode features in C++11 when comparing thes...

boost gauge problem or turbo proble??

scoobynet.com - 2012-08-24 15:18:15 - Similar - Report/Block

hi guys!! ive heard that the boost gauge when idle should be in the minus or vacuum side!! mine seems to be on zero or just below. the boost gauge came with the car and isnt the best, im getting a new prosport boost gauge next month just in case it is the gauge. does anybody think its a problem anywhere else i.e the turbo, or could it be...

Compilation error with a boost::spirit parser

stackoverflow.com - 2012-02-26 15:03:11 - Similar - Report/Block

I have a strange problem with a calculator made using boost::spirit. This calculator is supposed to take a string as argument representing a series of arithmetical expression separated by commas, like "a+4*5,77,(b-c)*4". It also allows the string "?" and returns the array containing a -1 in this case. The calculator is initialized with a...

C for Beginner - part1 : Computer Programming Basics

codecall.net - 2013-02-20 08:57:51 - Similar - Report/Block

Hello everyone! This series of tutorials are for those who are beginner and want to learn C programming. If someone knows about computer programming that's good but if not, this tutorial will guide you to learn about computer programming and then we will start learning C programming. Computer Programming Computer doesn't know English or o...

Consume only part of data in boost::asio basic_stream_socket::async_read_some handler

stackoverflow.com - 2012-03-29 17:12:35 - Similar - Report/Block

I am new into boost::asio so my question maight be dumb - sorry if it is such. I am writing asynchronous server application with keepalive (multiple requests may be sent on single connection). Connection handling routine is simple: In a loop schedule read request with socket-> async_read_some(buffer, handler) from handler schedule write...

Writing question numbers

thestudentroom.co.uk - 2013-06-10 17:47:59 - Similar - Report/Block

Just did an exam. There were loads of questions and I had to answer three, so I have to write the question numbers on the left hand side of the booklet. But I have this nagging feeling that I may have forgotten to write one of the question numbers for one of the questions I answered. My school said 'it should be fine' so I called up the e...

索泰GTX650Ti Boost-2GD5 纯金属散热器_夏天拒绝点不亮 大厂主流配置清凉推荐

zol.com.cn - 2013-05-20 05:10:00 - Similar - Report/Block

2013-05-20 05:10:00 作者:徐邦赫 推荐理由: 索泰GTX650Ti Boost-2GD5 极速版 HA是从自己产品下生产出来的高品质主打性价的显卡,显卡拥有出色的BOOST加速能 力,产品性能直逼GeForce GTX 660,索泰的全金属散热设计也让其出色的展示出的清凉的运行状态。 显卡介绍: 索泰GTX650Ti Boost-2GD5 极速版 HA显卡性价比直逼Radeon HD 7850 1GB版本,显卡的BOOST功能和对核心的开发能够将DX11单机大作运行流畅,同 时显卡的做工也完美传承了索泰一贯的高品质。 索泰GTX650Ti-1GD5 毁灭者TSI HA 索泰GTX650Ti Boost-2GD5 极速版 HA显卡采用的是标准的DP+H...

сериализация boost, xml_woarchive, ошибка линкования

cyberforum.ru - 2012-07-19 10:56:01 - Similar - Report/Block

При попытке использовать boost::archive::xml_woarchive с std::wofstream выдает: C:/boost/include/boost-1_49/boost/archiv e/xml_woarchive.hpp:120: undefined reference to `boost::archive::xml_woarchive_impl<b oost::archive::xml_woarchive>::xml_wo archiv e_impl(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >&, unsi...

boost::geometry::model::box и boost::geometry::area - Boost C++

cyberforum.ru - 2013-04-30 16:44:18 - Similar - Report/Block

Здравствуйте! Пытаюсь измерить площадь box'a :D, но не знаю как правильно это сделать. Вот этот код при компиляции выдает кучу ошибок: Код: #include #include #include using namespace boost::geometry::model; using namespace boost::geometry::model::d2; int main(int argc, char* argv[]) box> b(point_xy(0.0f, 0.0f), point_xy(2.0f, 2.0f)); st...




dialogShowMessage!

Fill out the form you see below. Registration is free, fast and simple.
If you are already registered, sign in page login.


Web Site :
Required Field
First Name :
Required Field
Last Name :
Required Field
Email :
Required Field
Sex :
Required Field

evolveStar.com is free for ever !


evolveStar.com provides a search engine that allows you to gather information to write their own blog.


evolveStar.com enhances the sources displaying the logo of the site.


If you want to remove your site or you believe a site listed infringes copyright, please report it to: info@evolvestar.com


Specifies the subject copyright violation and the url of the page


evolveStar.com respecting the law DMCA (Digital Millennium Copyright Act) will immediately remove whatever its merits.


Next will be effectual and relevant checks.







Who We Are Partner Advertising Contacts Privacy terms Help & FAQ

© Copyright 2010-2017 Fabrizio Fichera. All rights reserved.