Emil Dotchevski | 1 Mar 01:10 2010
Picon

Re: [Exceptions] Custom type in error_info value?

2010/2/28 Andrew Chinkoff <achinkoff <at> gmail.com>:
> So, my question: what should I do with 'MyClass' to see the output like
> this:
>
>> Throw in function (unknown)
>> Dynamic exception type: struct MyException
>> [PAUmy_tag2 <at> ?1?main <at> ] = qweqwe (Wow !!! Terrible dump is replaced with
>> readable string here !!!???)
>> [PAUmy_tag2 <at> ?1?main <at> ] = asdasd

See http://www.boost.org/doc/libs/release/libs/exception/doc/diagnostic_information.html.

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode
Olaf Meeuwissen | 1 Mar 01:09 2010
Picon

Re: boost test: How to make boost test a friend ?


Gennadiy Rozental wrote:
> Avi Bahra wrote:
>> I am looking into boost test.
>> I dont not want to expose some member functions as public.
>> However I need to access them for testing, is there
>> any way making boost test a friend of this class ?
> 
> You do not really need to make Boost.Test routines friends of your
> class. You should be able to get away with making your test functions as
> friends.

Another option is to make those member functions protected and derive a
class for testing purposes that promotes them to public.

  class A {
    int a;
  protected:
    int get_value () { return a; }
  };

  class test_A : public A {
  public:
    using get_value ();
  };

Now your tests can use test_A objects and access its public get_value().
Just keep class test_A out of your program/module and everything should
be fine.

(Continue reading)

Andrew Chinkoff | 1 Mar 01:24 2010
Picon

Re: [Exceptions] Custom type in error_info value?

Thanks!

2010/3/1 Emil Dotchevski <emildotchevski <at> gmail.com>
2010/2/28 Andrew Chinkoff <achinkoff <at> gmail.com>:
> So, my question: what should I do with 'MyClass' to see the output like
> this:
>
>> Throw in function (unknown)
>> Dynamic exception type: struct MyException
>> [PAUmy_tag2 <at> ?1?main <at> ] = qweqwe (Wow !!! Terrible dump is replaced with
>> readable string here !!!???)
>> [PAUmy_tag2 <at> ?1?main <at> ] = asdasd

See http://www.boost.org/doc/libs/release/libs/exception/doc/diagnostic_information.html.

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode
_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Russell L. Carter | 1 Mar 01:33 2010

best boost cc-mode style

Hi folks,
I'm starting to get heavy into templates and it seems my ancient
cc-mode customizations are a disaster when trying to format
complicated template code.  I'm now using emacs23 with cc-mode
version 5.31.7.  What's the best out-of-the-box cc-mode style for boost
style template formatting?  (Some googling revealed that Dave A.
a long time ago made some mods to cc-mode, what style did they
end up in?)

tnks,
Russell
Agustín K-ballo Bergé | 1 Mar 01:39 2010
Picon

[android] Boost + Android NDK

I would like to hear from other's experiences on using Boost togheter
with Android NDK. Personally, while I have been unable to build Boost, I
am successfuly using (pieces of):

· Array
· Assign
· Date Time
· Enable If
· Flyweight
· Function Types
· Fusion
· GIL
· Integer
· MPL
· Preprocessor
· Random
· Rational
· Spirit (which itself uses Proto)
· Tuple
· Type Traits

as well as the proposed:
· Endian
· LA (Static Size Linear Algebra)
· MSM

I was forced to hack code here and there, due to lack of exceptions and
RTTI. I also had to add configuration macros for endiannes, and a
DateTime related macro to have microsec_clock available.

Anyone else would like to share its experience? Particularly, was anyone
succesful to build boost on Android? And finally, is there interest in
patching Boost to make it more 'Android friendly'? This would also
benefit other (possibly embedded) systems which run with exceptions and
RTTI turned off.

Agustín K-ballo Bergé.-
fmingu | 1 Mar 02:17 2010

Have Boost random Library contained the function for generating Gaussian noise ? Can any one with kindness help me?

I am a new comer and using Boost library for math works.
I want to know whether  Boost Random Library contained the function for generating Gaussian noise. Or  Gaussian noise can be easily  generated by the functions in Boost Random Library? Or any other library compatible with the Boost Random Library?
 
Can any one with kindness help me?


_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Diederick C. Niehorster | 1 Mar 02:31 2010
Picon

Re: Have Boost random Library contained the function for generating Gaussian noise ? Can any one with kindness help me?

If with Gaussian noise you mean drawing from a normal distribution
(which you can scale and shift as you wish of course), then yes. See
http://www.boost.org/doc/libs/1_42_0/libs/random/random-distributions.html#normal_distribution
referenced on http://www.boost.org/doc/libs/1_42_0/libs/random/index.html.

Best,
Dee

2010/3/1 fmingu <fmingu <at> 163.com>:
> I am a new comer and using Boost library for math works.
> I want to know whether  Boost Random Library contained the function for
> generating Gaussian noise. Or  Gaussian noise can be easily  generated by
> the functions in Boost Random Library? Or any other library compatible with
> the Boost Random Library?
>
> Can any one with kindness help me?
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users <at> lists.boost.org
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Matthias Vallentin | 1 Mar 03:10 2010
Picon

[ptr_container] view_clone_allocator with associative containers

I cannot get the view_clone_allocator to work with associative containers, as
in the example below:

    boost::ptr_vector<int> vec;
    boost::ptr__map<std::string, int, boost::view_clone_allocator> map;

    int* i = new int(42);
    vec.push_back(i);

    std::string k("foo");
    map.insert(k, i);

>From the error message, it seems that the CloneAllocator is still of
type boost::heap_clone_allocator. 

Why is this failing? It seems intuitive to specify the allocator as
third parameter, similar to the example with ptr_vector where the 
allocator is the second argument.

   Matthias
--

-- 
Matthias Vallentin
vallentin <at> icsi.berkeley.edu
http://www.icir.org/matthias
Lubomir Bourdev | 1 Mar 03:40 2010
Picon

Re: [GIL new_io] Some questions about TIFF handling

Hi Olivier,

I will let Christian answer the tiled TIFF question. As for why bits32f is scoped 0..1: GIL channel types have a notion of a minimum and maximum value, which is used for many operations, such as converting from one channel to another, in particular in color conversion. Float and double are perfectly valid GIL channels, but their scope is –inf to inf, so you cannot linearly interpolate from a float to an uint8, for example. Thus they are not as useful as bits32f, but you can use them as long as you are careful not to do any operations that require using their range.
You are free to define a float/double channel with any other range you might find useful, such as 0..255 or –1..1
In Photoshop, for example there is a channel type that goes from 0 to 32768

Lubomir




On 2/28/10 9:48 AM, "Olivier Tournaire" <olitour <at> gmail.com> wrote:

Hi all (and in particular Christian),

I have some questions about TIFF reader/writer in GIL new_io.
First, I do not understand why bits32f are scoped in the range [0.f ... 1.f]. It is for our applications a real limitation because we use float TIFF images not scoped in the range. We thus have to define a new type (e.g. bits32F) which is not scoped and simply typedef float bits32F. In addition, why double is not "typedefed" by default? We also have to define a new type: typedef double bits64f. Double however seems to be supported in the writer.

Last, but not least, there is no support for tiled TIFF. Nothing about tiled TIFF is defined in tiff_tags.hpp. Maybe we could add in tiff_device_base a read_tile method, similar to read_scaline (sic), but which simply swap TIFFReadScanline with TIFFReadTile.

So, do you plan to add this stuffs in the new version of GIL io? Maybe I could help. Let me know.

Best regards,

Olivier

_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Manjunath Kudlur | 1 Mar 04:21 2010
Picon

Re: [proto] defining function call operators on expressions

On Sun, Feb 28, 2010 at 1:28 AM, Eric Niebler <eric <at> boostpro.com> wrote:
>
> On 2/28/2010 7:17 PM, Manjunath Kudlur wrote:
>>
>> I am trying to define operator()(...) for my expressions. I want to be
>> able to form expression of the form Program_(a,b) and call Program_(a,
>> b)(10,20). Here, 'a' and 'b' are terminals and I have a mechanism
>> shown in the code below that somehow gets the type suitable for the
>> parameter position. Suppose 'a' is terminal<Var<int>  >, I want the
>> first parameter position in Program_(a,b) (pos1, pos2) to be of the
>> type 'int'.
>
> <snip>
>
> OK.
>
>> template<int N>
>> struct call_param_type
>>   : proto::or_<
>>     proto::when<
>>     proto::function<
>>     proto::terminal<program_>,
>>     proto::vararg<proto::terminal<Var<proto::_>  >  >  >,
>>     var_type(proto::_child_c<N+1>)>
>> > {};
>
> OK, the call_param_type grammar only matches expressions of the type
> Program_(a, b).
>
>> template<typename Expr>
>> struct program_expr {
>>   BOOST_PROTO_BASIC_EXTENDS(Expr, program_expr<Expr>, program_domain);
>>   BOOST_PROTO_EXTENDS_SUBSCRIPT();
>>
>>   typedef void result_type;
>>
>> #if 0
>>   result_type operator()(typename
>> boost::result_of<call_param_type<0>(const Expr&)>::type x) {
>>     std::cout<<  "program with one arg\n";
>>   }
>
> <snip>
>
> This function definition eagerly evaluates the call_param_type grammar's
> transform against Expr regardless of whether Expr matches call_param_type's
> grammar or not. Trouble. Look at how you define the Program_ function:
>
>> template<typename A0>
>> typename proto::result_of::make_expr<proto::tag::function
>> , program_domain
>> , program_
>> , A0 const &>::type const
>> Program_(A0 const &a0)
>
> This creates an expression node with tag type "tag::function" and two
> children: a program_ terminal and A0. When make_expr turns program_ into a
> Proto terminal, it uses program_domain to wrap the terminal in a
> program_expr. That's bad news because a program_ terminal doesn't match the
> call_param_type grammar. You're violating the transform's precondition.

Yeah, got it. I realise now that the passing a domain to make_expr
wraps all the components of the expression also with the corresponding
expression class. What I am unable to figure out it how to wrap only
the final expression I want with program_expr. In this case I want to
wrap expr<tag::function, vararg<terminal<Var> > > with program_expr.
Is there an example I can look at that does something similar? Or is
this the wrong way to look at the problem? Basically, I want to add
the function call operator to my expressions, but only to expressions
of certain forms. My thinking is, if I only wrap expressions of that
certain form with my expression class, I should be OK, no?

Manjunath

> Suggestion: when you are having problems with evaluating a transform, try
> adding an MPL assertion that the expression you're passing to it actually
> matches the grammar.
>
> HTH,
>
> --
> Eric Niebler
> BoostPro Computing
> http://www.boostpro.com
> _______________________________________________
> Boost-users mailing list
> Boost-users <at> lists.boost.org
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>

Gmane