Bonjour,

Je suis vraiment débutant en c++, et j'aimerais utiliser la bibliothèque boost car j'utilise l'arithmétique d'intervalles (c'était déjà la galère pour l'inclure dans mon projet, mais j'y suis arrivé enfin ). Maintenant, je veux faire des test en créant des intervalles et en faisant des opérations élémentaires dessus (+,*,-...), mais je rencontre un problème erreur : expected unqualified-id before '+' token, le code est le suivant :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 
#include "boost/lambda/lambda.hpp"
#include "boost/numeric/interval.hpp"
#include "boost/numeric/interval/utility.hpp"
#include "boost/numeric/interval/arith.hpp"
#include "boost/numeric/interval/arith2.hpp"
#include "boost/numeric/interval/arith3.hpp"
#include <iostream>
#include <iterator>
#include <algorithm>
 
int main()
{
    using namespace boost::numeric;
    using namespace interval_lib;
    typedef interval<double> I1;
    typedef interval<double> I2;
    typedef interval<double> I3;
    I1(1,5);
    I2(10,20);
    I1 + I2;
 
    using namespace boost::lambda;
    typedef std::istream_iterator<int> in;
 
    std::for_each(
        in(std::cin), in(), std::cout << (_1 * 3) << " " );
}
Merci,