|
|
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...
|
|
|
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...
|
|
|
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...
|
|
|
|
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...
|
|
|
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...
|
|
|
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...
|
|
|
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...
|
|
|
|
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...
|
|
|
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>.. .
|
|
|
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...
|
|
|
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...
|
|
|
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(...
|
|
|
|
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...
|
|
|
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(...
|
|
|
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...
|
|
|
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...
|
|
|
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...
|
|
|
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...
|
|
|
|
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...
|
|
|
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...
|
|
|
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...
|
|
|
|
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...
|
|
|
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.
|
|
|
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...
|
|
|
|
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...
|
|
|
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.
|
|
|
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...
|
|
|
|
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(...
|
|
|
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...
|
|
|
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...
|
|
|
|
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...
|
|
|
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...
|
|
|
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...
|
|
|
|
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...
|
|
|
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...
|
|
|
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...
|
|
|
|
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...
|
|
|
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...
|
|
|
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...
|
|
|
|
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...
|