I have a program that generates graphs using different multi-level models. Each multi-level model consists of a generation of a smaller seed graph (say, 50 nodes) which can be created from several models (for example - for each possible edge, choose to include it with probability p).
After the seed graph generation, the graph is expande...
Is there an existing function (in boost mpl or fusion) to splat meta-vector to variadic template arguments? For example:
splat<vector<T1, T2, ...>, function>::type
// that would be the same as
function<T1, T2, ...>
My search have not found one, and I do not want to reinvent one if it already exists.
Alternatively, is there a solutio...
I'm trying to write a program to help me manage my iTunes library, including removing duplicates and cataloging certain things. At this point I'm still just trying to get it to walk through all the folders, and have run into a problem: I have a small amount of Japanese music, where the artist and/or album is written in Japanese characte...
hello.
Is there macro, something like BOOST_AUTO, which would allow to emulate automatic return type deduction of function in C++?
I mean something like trailing-return-type, http://en.wikipedia.org/wiki/C%2B%2B0x#Alternative_function_syntax
this is what I have:
using namespace boost::fusion;
#define AS_VECTOR(var, expr) BOOST_AUTO(v...
I got class with template methods that looks at this:
struct undefined {};
template<typename T> struct is_undefined : mpl::false_ {};
template<> struct is_undefined<undefined> : mpl::true_ {};
template<class C>
struct foo {
template<class F, class V>
typename boost::disable_if<is_undefined<C> >::type
apply...
I have an file that is a long list of weighted edges, in the following form
node1_id node2_id weight
node1_id node3_id weight
and so on. So one weighted edge per line.
I want to load this file into boost graph and find the connected components in the graph. Each of these connected components is a subgraph. For each of these compon...
Hello, I'm using boost::function for making references to the functions. Can I make a list of references?
For example:
boost::function<bool (Entity &handle)> behaviorRef;
And I need in a list of such pointers. For example:
std::vector<behaviorRef> listPointers;
Of course it's wrong code due to behaviorRef isn't a type.
So the ques...
Hello, I have another one question about functions reference.
For example, I have such definition:
typedef boost::function<bool (Entity &handle)> behaviorRef;
std::map< std::string, ptr_vector<behaviorRef> > eventAssociation;
The first question is: how to insert values into such map object?
I tried:
eventAssociation.insert(std::pair...
I need to build Boost with a non-standard set of flags (due to a conflict between Boost threading and C++/CLI). I'm adding the required flag (/clr) using CXXFLAGS, but this flag conflicts with the Boost default /EHs flag (/clr implies /EHa which is incompatible with /EHs), so that needs to be suppressed. Is there a mechanism like CXXFL...
Hi, I'm using boost::function for making function-references:
typedef boost::function<void (SomeClass &handle)> Ref;
someFunc(Ref &pointer) {/*...*/}
void Foo(SomeClass &handle) {/*...*/}
What is the best way to pass Foo into the someFunc?
I tried something like:
someFunc(Ref(Foo));
...
Is there some equivalent class for C++1x's std::unique_ptr in the boost libraries? The behavior I'm looking for is being able to have an exception-safe factory function, like so...
std::unique_ptr<Base> create_base()
{
return std::unique_ptr<Base>(new Derived);
}
void some_other_function()
{
std::unique_ptr<Base> b = create_bas...
I'm reading path names from a database which are stored as relative paths in Windows format, and try to create a boost::filesystem::path from them on a Unix system. What happens is that the constructor call interprets the whole string as the filename. I need the path to be converted to a correct Posix path as it will be used locally.
I ...
properties/C/C++ Build/Settings
GCC C++ Linker/Libraries
Under libraries(-I) I have
libbost_system
libbost_filesystem
...
and under Library search path(-L) I have
/home/etobkru/boost_1_43_0/boostBinaries/lib
but when I compile I get
g++ -L/home/etobkru/boost_1_43_0/boostBinaries/lib/ -o"searchDirs" ./main.o -llibboost_system -llib...
boost::operators automatically defines operators like + based on manual implementations like += which is very useful. To generate those operators for T, one inherits from boost::operators<T> as shown by the boost example:
class MyInt : boost::operators<MyInt>
I am familiar with the CRTP pattern, but I fail to see how it works here. Spe...
I know I could use the following:
template <typename Pair>
struct ComparePairThroughSecond : public std::unary_function<Pair, bool>
{
bool operator ()(const Pair& p1, const Pair& p2) const
{
return p1.second < p2.second;
}
};
std::set<std::pair<int, long>, ComparePairThroughSecond> somevar;
but wondered if i...
Hi,
In my program, I have a list of "server address" in the following format:
host[:port]
The brackets here, indicate that the port is optional.
host can be a hostname, an IPv4 or IPv6 address (possibly in "bracket-enclosed" notation).
port, if present can be a numeric port number or a service string (like: "http" or "ssh").
If p...
Hi there,
I'm trying to build my application with MSVC 2010 instead of GCC. With GCC everything works fine. My app uses boost_system and boost_thread libraries.
I built boost with VC2010 in "system" layout, that means the libraries are named just libboost_system.lib (and not libboost_system_compiler_threading_version_wtf_snafu.lib)
The...
I am trying to run boost in eclipse,
under Library search path I have put:
/home/etobkru/boost_1_43_0/boostBinaries/lib/
and under Libraries I have put all the libs, boost_system, etc.
The build is working without errors but when am trying to run the program I get an error:
error while loading shared libraries: libboost_system.so.1.43...
I have not used Unit Testing so far, and I intend to adopt this procedure. I was impressed by TDD and certainly want to give it a try - I'm almost sure it's the way to go.
Boost looks like a good choice, mainly because it's being maintained. With that said, how should I go about implementing a working and elegant file-structure and proj...