« first day (353 days earlier)      last day (2505 days later) » 
03:00 - 19:0019:00 - 00:00

7:25 PM
@jeyejow There's a Community Edition of Visual Studio that's free (for personal use, or small teams up to something like 5 people). You might also consider MinGW. From a language conformance perspective, the g++ that's included in MinGW is clearly the better of the two.
 
Hey is it correct that
int a = 0x8000000;
is actually undefined in C++ (before/after C++11)?
 
@JerryCoffin nice, ill install WinGW and take a look
 
@Felix.C It could give undefined behavior. int is required to be at least 16 bits, but not necessarily 32. That said, unless you're dealing with MS-DOS or a fairly small embedded system, it's unlikely to arise in practice.
I'd guess you intended to use 0x80000000 instead of 0x8000000 (one extra 0). That way it's too large to fit into a 32-bit signed number as well. In that case it's not portable, even among platforms where int is 32 bits.
 
@JerryCoffin Excuse my very bad example just as now I figured it myself. My question is assuming we have an int with n bits, e.g. an integer has n bits on our target platform, and we use a integer literal with the (n-1)-th bit set then obviously it does not fit into a signed integer, what happens then, is it undefined?
 
@Felix.C Yes (at least if memory serves--it's barely possible it's implementation defined instead, but I'm too lazy to look that up right now, especially since there's little practical difference between the two).
 
7:35 PM
@JerryCoffin If you allow me that last question, where would you look up something like that? Excuse I'm a bloody young student ;)
 
@Felix.C I'd look it up in the C or C++ standard. Drafts of the C++ standard are available on Github.
 
@JerryCoffin Ok thanks!
 
@Felix.C Fair warning: it is the standard, not a tutorial. Don't expect a lot of hand holding. Finding the things you care about can be non-trivial...
 
@JerryCoffin i installed the MinGW and it installed me a folder with alot of files and other folders inside. What do i do now? it that what it was supposed to download? how do i start coding and were?
 
@jeyejow One of the files there is a batch file named "open distro window" or something like that. I usually create a shortcut to it on my desktop. Anyway, it'll open a command line; from there, you type g++ myfile.cpp to compile and link that file. In a warped version of Unix tradition, the output will be named a.exe, unless you specify otherwise. Editing the code is handled separately with an editor of your choice.
 
7:44 PM
ohhh ok ill try
ok, it gave no error, it waited for a while to think and then did nothig, were is the generated .exe file is? i typed this command: g++ path_of_cpp\file.cpp
@JerryCoffin
nvm
i found it, its inside the folder
omg it works :D thatas awsome
does it has all the predifined libraries the visual studio has?
i guess it does
:V
 
8:30 PM
I have a CMake problem where I try to link a shared library to my project. The "clucky" way works:

add_executable(test ${SOURCE_FILES})
target_link_libraries(test ${CMAKE_SOURCE_DIR}/vendor/mipcl-1.4.0/lib/libmipcl.so.1.4.0)

Now, I more elegant way would be to use find library:

find_library(
MIPCL_LIBRARY
NAMES mipcl
PATHS ${CMAKE_SOURCE_DIR}/vendor/mipcl-1.4.0/lib
)
message("MIPCL is at: ${MIPCL_LIBRARY}")

which doesn't find the library... What could be the problem?
 
8:41 PM
@JerryCoffin Thanks for the advice, actually I figured it to be ok..I just wondered about this disclaimer that formatting is bad, it includes bad errors and so on...
 
8:59 PM
@Felix.C That disclaimer is included in all the drafts. Doesn't really mean much (but if you do find errors, feel free to report them).
 
 
1 hour later…
10:08 PM
hello
can someone takes a look on what is wrong in this question regardlessly of what 'boost' library does, or is it just me who notices a comparative order between addresses
the iterator pointer here isnt init'ed, so getting the enumerator abruptly to the end() overflows to beyond the bound as not only i think, but as the compiler responds too
 
10:54 PM
@Idle001 Your answer is (probably) downvoted because it doesn't answer the question.
The interaction between Boost.Range, lambdas and iterators is the core of this question, but you completely skipped over the first two
@Idle001 No, that's completely not what happens
 
11:14 PM
@milleniumbug yes i think the 'boost' lib is unmissedly required by the op, but i could replicate the same error from the question except if i use rbegin() = reversed begin instead of end()
 
Which doesn't help fix the OPs problem at all
Basically what happens is this: OP writes a larger program, it crashes; OP reduces the test case to three statements; OP asks why the test case crashes
the expected semantics of the test case are not even relevant
 
my side, the program crashes after seg faulting, well i dunno i just proposed a solution
 
It's not a solution because it doesn't solve anything
Also: iterator comparison is perfectly fine to do. Look, range-for statement does it
 
11:34 PM
I'm not asking why my answer attracted low rating, it's obvious that i missed something i made a PS at the bottom of my post asking about what i missed or what i didnt get clear, so iterator comparison is fine, right, why the code doesnt throw exception with my solution ?
 
neither the OP's code nor yours throw exceptions
OPs code crashes the program, your aborts it due to failed assert
and you're comparing the values which are pointed to by the iterators
 
(result.begin()->begin()) == ((result.end() - 1)->end() - 1); this throws by itself Vector iterators incompatible, i'm running VS2015 with boost installed
 
yes, this is because it's illegal to compare iterators you got from one container with the iterator you got from another one
 
oh right
 
note that the OP's code would have crashed even if it had done result.begin()->begin() == result.begin()->begin()
and the reason for this is presented in the T.C.'s answer
 
03:00 - 19:0019:00 - 00:00

« first day (353 days earlier)      last day (2505 days later) »