|
Clang-on-Windows is probably not a supported configuration for Boost. You could try to push those changes into Boost (although they'll probably ask you to test on a newer release / trunk), but yeah, even if you get that to work, you are very likely to run into interop problems if your other libraries actually use C++ interfaces. Sorry; it's something the community's actively working on, but it's not done yet by any means.
|
# ? May 4, 2013 00:10 |
|
|
# ? Jun 8, 2024 01:21 |
|
I found the first three posts on that bug report in some mailing list thing, but it didn't have the rest of it and the actually bug report never showed up. Why you hate me google? Anyway, that's kind of what I figured. It was an interesting experiment, but back to what I was doing before. Thanks
|
# ? May 4, 2013 00:26 |
|
I'm trying to get my CMake project that uses clang and C++11 (libc++) to work with Google Test but I keep getting errors of the following sort during linking: quote:Undefined symbols for architecture x86_64: Volte fucked around with this message at 01:51 on May 4, 2013 |
# ? May 4, 2013 01:45 |
|
Obvious reason would be if -stdlib=libc++ is only getting passed to the compiler and not to the linker.
|
# ? May 4, 2013 02:24 |
|
Plorkyeran posted:Obvious reason would be if -stdlib=libc++ is only getting passed to the compiler and not to the linker.
|
# ? May 4, 2013 02:26 |
|
Why does using move semantics have to be so cumbersome. So I have to create a move constructor AND mark it noexcept in order for std::vector to actually move it instead of copy it. Would I still have to mark the constructor noexcept if I was able to disable exceptions?
|
# ? May 4, 2013 19:00 |
|
C++ with exceptions disabled is no longer (standard) C++, so it really depends on your compiler. If I had to take a guess, I'd assume that you'd still have to mark it noexcept, because the noexcept operator probably doesn't take into account that exceptions are disabled.
|
# ? May 7, 2013 00:57 |
|
I'm working in Thrust, is there a nice way to do a transform and reduce some result in a single step while still keeping the transformed output? It could be done with a transform_iterator plus some kind of a copy-accumulate set operation. I don't know what that would be though.
|
# ? May 8, 2013 03:19 |
|
Is there something in Boost for iterating compound containers? An example of such a container would be a map of strings to vectors of something else. I was hoping there was a way I could set up an iterator that would move on to the next vector in the map as soon as it exhausted all elements in the prior mapped vector. Right now I'm tracking two iterators, and that's generally fine, but I got that sense that implies there's a better solution out there.
|
# ? May 8, 2013 07:48 |
|
Rocko Bonaparte posted:Is there something in Boost for iterating compound containers? An example of such a container would be a map of strings to vectors of something else. I was hoping there was a way I could set up an iterator that would move on to the next vector in the map as soon as it exhausted all elements in the prior mapped vector. Right now I'm tracking two iterators, and that's generally fine, but I got that sense that implies there's a better solution out there. I don't think there's anything directly for this, but you could make one. To be honest, though, that has its own problems unless you want to sink some time into it. Matt Austern has a paper about iterators like these if you're interested.
|
# ? May 8, 2013 08:45 |
|
loving goddamned hell, I hate Sun Studio, it's IDE and compiler both. I'm not familiar, short of learning my way around xemacs/gvim, are there any traditional IDEs that get a lot of use on UNIX systems (preferably that support both Intel and SPARC processors)? I'm seeing Eclipse and Netbeans out there but with Sun Studio's IDE based on those I'd rather make a clean break if I can, and I don't know what the Visual Studio-style gold standard is. (edit) To clarify it doesn't have to mirror Visual Studio or anything, I just need to be able to do some analog of right click->Go to Definition on anything in my code, syntax highlighting, etc. And yeah I know that UNIX sort of prefers not having IDEs at all but damnit I get lost fast without some IntelliSense analog. Ciaphas fucked around with this message at 00:36 on May 9, 2013 |
# ? May 9, 2013 00:23 |
|
Ciaphas posted:loving goddamned hell, I hate Sun Studio, it's IDE and compiler both.
|
# ? May 9, 2013 00:32 |
|
I've found that Sublime Text paired with the SublimeClang plugin works pretty well. It gives you pretty good intellisene, inline error output, go to definition/implementation, etc. It's not a full blown IDE experience though. There isn't support for advanced refactoring, for example.
|
# ? May 9, 2013 04:04 |
|
How would an unsigned integer be represented in memory as compared to a signed integer?
|
# ? May 9, 2013 05:17 |
|
Probably exactly the same.
|
# ? May 9, 2013 05:24 |
|
Rothon posted:I've found that Sublime Text paired with the SublimeClang plugin works pretty well. It gives you pretty good intellisene, inline error output, go to definition/implementation, etc. It's not a full blown IDE experience though. There isn't support for advanced refactoring, for example. This looks pretty much like exactly what I need, but then I realized they don't have source code or a SPARC build. I hate these machines so much
|
# ? May 9, 2013 06:02 |
|
Yep, the only difference is that the compiler generates unsigned instructions for it.
|
# ? May 9, 2013 06:09 |
|
Well that's a relief. That means I bombed an interview less than I thought.
|
# ? May 9, 2013 06:16 |
|
It's a question that can be answered on a lot of different levels, but probably it should be taken as an opportunity to show that you understand things like two's complement.
|
# ? May 9, 2013 06:21 |
|
Two's complement signed integers is probably what the person was asking for. ... I probably asked this in here before, but has there realistically ever been another signed integer format? I'd imagine that Cray did something special, since they always did something special.
|
# ? May 9, 2013 06:31 |
|
Suspicious Dish posted:... I probably asked this in here before, but has there realistically ever been another signed integer format? I'd imagine that Cray did something special, since they always did something special. BCD, which gets used in hobby electronics and some old-school mainframes, strongly resembles sign-and-magnitude when used in a signed manner. Sign-and-magnitude is, of course, used in the significand in modern-day IEEE floating point. I personally own some hardware designed to do signal processing which uses One's-complement for all its arithmetic, because it was desirable to have both -0 and +0 representable.
|
# ? May 9, 2013 06:41 |
|
The other common one is excess-k, which is basically unsigned numbers with the implicit understanding that the entire range is offset by some amount. The most notable place this is used is in IEEE floating-point exponents.
|
# ? May 9, 2013 06:55 |
|
rjmccall posted:It's a question that can be answered on a lot of different levels, but probably it should be taken as an opportunity to show that you understand things like two's complement. Ah. I thought he was asking whether it had some special format like a floating point number. On the other hand, I did say what -1 would be represented as(correctly), so I'm hoping he was ok with it.
|
# ? May 9, 2013 07:13 |
|
Good golly, I'm not only rusty at C++, but I'm lacking in some of the intricacies too. I've never really worked on a big project, save for modding with Source in highschool, and have never started up a decently sized project myself. To make sure header files are included only once, is this best way? (Wiki calls this "include guards") code:
Also, I'm working with Qt framework, and I'm not sure if I'm supposed to use Qt's version's or not. One comes from string and QString, which seems to be a minor change to support Unicode-16. But the other is more of an unknown for me, do I use Qt's SQL plugins or manually add in the SQL libraries and code from there? For some info, this is a personal, "show-off" project to get me a job, so I just want whoever sees it to see that I understand SQL.
|
# ? May 9, 2013 17:55 |
That's #define, not If you want to show that you understand SQL, make sure whatever you use actually lets you write SQL, and doesn't wrap it in layers of ORM or other automatic statement generation. Apart from that, use whatever. (Qt might have some "data-aware" widgets, e.g. a table control that can automatically fetch and display rows from a table. That's not writing SQL.)
|
|
# ? May 9, 2013 18:17 |
|
nielsm posted:That's #define, not Quite! I kinda ran through that post without checking it. It has nothing to do with rust... quote:If you want to show that you understand SQL, make sure whatever you use actually lets you write SQL, and doesn't wrap it in layers of ORM or other automatic statement generation. To be fair, that's how I'm writing my core DB accessing classes. I guess my fear was someone looking at it and going "You never used a SQLite_stmt struct anywhere in this program, how can you claim to know SQLite?" Because the people that actually will check my github will really delve into my code and cross-check my competencies. They won't go, "Oh look, here's a thing. It's big and it compiles. And this was something he did for fun." It's totally the former.
|
# ? May 9, 2013 21:08 |
Using direct APIs and using abstraction layers are different skills, but they are both valuable skills. One argument for using any database abstraction Qt provides is that if you're picking a framework like that it's usually better to go all in, anything else can easily lead to frustrations hacking around things.
|
|
# ? May 9, 2013 21:30 |
|
BirdOfPlay posted:
Last time I checked, GCC (probably 4.6.x something) still had some issues with #pragma once, in particular when used in conjunction with precompiled headers. #pragma once gives you a minuscule boost in compilation speed compared to include guards (a couple of seconds on a codebase taking 10-15 minutes to compile), but not really worth it unless you know you're only targeting Visual Studio. Then again you could always use both.
|
# ? May 10, 2013 03:34 |
|
It's still not fixed, so you should always use include guards for headers that will be installed and may be included in someone else's precompiled header, but generally projects don't put their own files in the PCH anyway so #pragma once is fine for local headers.
|
# ? May 10, 2013 03:47 |
|
Vinterstum posted:Last time I checked, GCC (probably 4.6.x something) still had some issues with #pragma once, in particular when used in conjunction with precompiled headers. #pragma once gives you a minuscule boost in compilation speed compared to include guards (a couple of seconds on a codebase taking 10-15 minutes to compile), but not really worth it unless you know you're only targeting Visual Studio. I don't think that would be the case that it gives a speed boost in gcc: http://gcc.gnu.org/onlinedocs/gcc-4.8.0/cpp.pdf posted:This construct is commonly known as a wrapper #ifndef. When the header is included Previous versions of gcc even called the feature obsolete: http://gcc.gnu.org/onlinedocs/gcc-2.95.3/cpp_1.html#SEC8 posted:The GNU C preprocessor is programmed to notice when a header file uses this particular construct and handle it efficiently. If a header file is contained entirely in a `#ifndef' conditional, then it records that fact. If a subsequent `#include' specifies the same file, and the macro in the `#ifndef' is already defined, then the file is entirely skipped, without even reading it. The wikipedia page for pragma once even indicates that other major compilers all have special logic to recall that a file was 100% in an include guard and already included.
|
# ? May 10, 2013 14:01 |
|
Notedly Google ran a huge test to see if even MSVC gained performance with #pragma once, subsequently a huge commit hit the repos ... https://groups.google.com/a/chromium.org/forum/?fromgroups=#!topic/chromium-dev/RMcVNGjB4II
|
# ? May 10, 2013 14:32 |
|
That thread is kind of hilarious.quote:You can take perfectly valid 100% correct ANSI C program, add "#pragma once" to one file and the end result will be incorrect program. That's dangerous. If you perceive it as "right" or "wrong" is another question. Adding a line of code to a correct program can make that program incorrect, therefore being able to add lines of code is dangerous?
|
# ? May 10, 2013 14:43 |
|
MrMoo posted:Notedly Google ran a huge test to see if even MSVC gained performance with #pragma once, subsequently a huge commit hit the repos ... Dang that's a lot of Googlers that don't understand what an include guard does and does not do! I enjoyed the cameo from yung ~LoNeWoLf~ as well.
|
# ? May 10, 2013 14:49 |
|
C++ code:
|
# ? May 10, 2013 15:25 |
|
Otto Skorzeny posted:Dang that's a lot of Googlers that don't understand what an include guard does and does not do! I enjoyed the cameo from yung ~LoNeWoLf~ as well. I don't think there was a lot of misunderstanding going on, just a lot of miscommunication back and forth.
|
# ? May 10, 2013 21:35 |
|
Otto Skorzeny posted:Dang that's a lot of Googlers that don't understand what an include guard does and does not do! I enjoyed the cameo from yung ~LoNeWoLf~ as well. It's just one guy that doesn't know what an include guard is and several people confused about why he's talking about these unrelated things.
|
# ? May 10, 2013 22:42 |
|
So, I didn't really want to trudge through the poo poo in there. Did #pragma once have any perf impact on MSVC or gcc, at all?
|
# ? May 10, 2013 22:57 |
|
Are there any situations where you WOULD want to have a header #included more than once for a given translation object? I can't think of any short of "C is old and they didn't really do it right"
|
# ? May 10, 2013 23:26 |
Suspicious Dish posted:So, I didn't really want to trudge through the poo poo in there. Did #pragma once have any perf impact on MSVC or gcc, at all? It did shave some seconds off on MSVC to use #pragma once, from what I gathered. Ciaphas posted:Are there any situations where you WOULD want to have a header #included more than once for a given translation object? I can't think of any short of "C is old and they didn't really do it right" Well it isn't really a "header" any longer then, but it can be a kind of poor man's templating: Define some special macros, then include a file that declares stuff based on the values of those macros you defined. Of course you wouldn't be using include guards for those files either, at least if you're sane.
|
|
# ? May 10, 2013 23:38 |
|
|
# ? Jun 8, 2024 01:21 |
|
Suspicious Dish posted:So, I didn't really want to trudge through the poo poo in there. Did #pragma once have any perf impact on MSVC or gcc, at all? gcc doesn't even need the #pragma once to know it doesn't need to reread include-guarded files. Ciaphas posted:Are there any situations where you WOULD want to have a header #included more than once for a given translation object? I can't think of any short of "C is old and they didn't really do it right" X-Macros and preprocessor loops.
|
# ? May 10, 2013 23:39 |