Lambda - boost on Windows
Aug 31, 2014 at 9:18pm UTC
Does anybody know why this code does not work on Windows?
I see just black window and nothing is printed. Maybe the function calculating lasts too long?
lambda.cpp in Visual Studio
1 2 3 4 5 6 7 8 9 10 11 12 13
#include "stdafx.h"
#include <boost/lambda/lambda.hpp>
#include <iostream>
#include <iterator>
#include <algorithm>
int main()
{
using namespace boost::lambda;
typedef std::istream_iterator<int > in;
std::for_each(
in(std::cin), in(), std::cout << (_1 * 3) << " " );
}
Edit:
One more question to the Boost. May I run boost timer from .c file? I see there are c++ dependencies.
Last edited on Aug 31, 2014 at 9:28pm UTC
Aug 31, 2014 at 9:36pm UTC
The program is waiting for user input. If input you 4 then hit enter, the program will print 12 and wait for more input.
Boost uses all manner of C++ features, especially templates. You can't use any of its libraries from C.
Topic archived. No new replies allowed.