Bind to a member's class method.

Hi,
I am rather beginner at boost - I am trying to achieve functionality
similiar to property getter/setter from managed languages like C#. I
have written the following code:
#include "boost\lambda\bind.hpp"
#include "boost\variant.hpp"
#include "boost\optional.hpp"
#include <iostream>
#include <map>
class Test
{
public:
boost::optional

On 03/21/2014 12:00 PM, Konrad Rybacki wrote:
Seems to me that you need to refer to the type of the member variable,
not the actual instance, so:
class Test
{
public:
typedef boost::optional

Hi,
Unfortunately, with the code you have proposed I get the following error:
boost_tests.cpp(33): error C3867: 'boost::optional<T>::get_value_or':
function call missing argument list; use
'&boost::optional<T>::get_value_or' to create a pointer to member
with
[
T=boost::variant

On 03/21/2014 12:31 PM, Konrad Rybacki wrote:
Sorry, I didn't test it, just assumed this was the source of the problem.
After some struggling I finally managed to fix the code, however the
solution isn't perfect.
#include
participants (2)
-
Adam Romanek
-
Konrad Rybacki