« first day (538 days earlier)      last day (4395 days later) » 

6:01 PM
@Ell why?
Unfortunately…
 
hello everyone, why does
list<Member*>::iterator it = member_list.begin();
for(it;it!=member_list.end();++it)
{
cout << it << endl;
}
how can i access the it functions?
for the Member*
 
(*it)->foo
 
that doesn't work
oww
sorry about that
thanks mate
 
Off-topic: On a modern(ish) Nokia phone, is it possible to access text messages that are stored on the SIM card?
(The phone has its own message store.)
 
Prefixing messages with "Off-topic: " is redundant in this room.
5
 
6:13 PM
@KerrekSB yes.
Every smartphone should have a way of accessing SIM text messages
and dumbphones have been that way forever
 
6:28 PM
@daknok_t it's sorta vague whether or not this room actually has a topic or not.
We claim it doesn't, but then get upset at people who talk about C/Java here.
 
Anything is on-topic.. except things we hate
 
I'd say it is C++ oriented, but everything but C++ is more welcome than C++.
 
Then they're offtopic *get off my lawn*
 
@daknok_t except PHP, Java (except for bashing thereof), and C.
 
That was too obvious to mention.
 
6:38 PM
@rubenvb I can't find any way...
I'm also stuck: for physical reasons, I cannot remove the SIM card and place it into a SIM-card-only phone.
 
Hmm, my bank is charging me $130/month to watch my credit history. Time to figure out how to cancel that...
 
Ell
hi guys
 
hey
 
Ell
@MooingDuck the reason I thought it was a pain was because I thought you had to use a class with the () operator but after I went I read I could just do &function so all is good :L
 
6:48 PM
@Ell yeah, same as the predicates for maps and sorts and such. A functionoid object or function.
 
Ell
is "generic" a property of the type system or a programming paradigm?
 
Xeo
@Ell I'd still very much recommend using a functor
inlining will beat the shit out of function pointers, performance wise
and signals are usually fired often enough to make it worthwhile
 
Ell
@Xeo really? Isn't it a lot more effort though, for every event I have to have a functor?
I might not even do this - I might just make virtual functions OnClick etc.
and you just derive from it
 
@MooingDuck How long have they been doing that?
 
@Collin two months
 
6:54 PM
@MooingDuck I can insure my house (worth far more than any identify theif could get access to) for like half that
 
Ell
Is using templates "static duck typing"?
 
Xeo
yes
 
I would say it's a form of it
 
Ell
I always think there should be a language where you can go
DoSomething(String this_that){blah blah}
where this_that is any object that can support all operations a String can
 
Concepts are less ducky though.
 
6:56 PM
@Ell C++ can do that via duck typing
 
Ell
so its sort of like templates, but the compiler does it all explicitly, but it is still staticly types
 
@Ell and most others via interfaces
 
@Ell There are dynamic languages where ducktyping like that is very prevalent
 
Xeo
template<class String>
void DoSomething(String this_that){ blah blah; }
 
Ell
@MooingDuck yeah but it seems so bolted on in my opinion
 
6:57 PM
@Ell C++ (using templates or polymorphism), Objective-C (using @protocols), Ruby (no types for arguments anyway)…
 
@Ell that's how C++ templates work.
 
Ell
@MooingDuck It would be nice if you didnt have to implicitly write interfaces
and yeah but its all ugly and stuff XD
I just dont see a need to not use templates, other than for clarity
sorry i have curry to eat but I will be back after :D
 
@Ell I don't know what you're talking about. Just do what Xeo wrote
what? I can't see context for flags?
How am I supposed to decide if it's a valid flag or not without context?
 
@Ell you'll get used to templates. They're much, much less pain than (runtime) polymorphism.
2
 
I don't know how avoiding templates increases clarity... that seems a very broad and (imo largely incorrect) statement
TMP scares me though.
 
7:01 PM
@Ell libraries should probably write templates a lot. A standalone program generally won't write templates much at all.
 
Why wouldn't it?
 
@CatPlusPlus generally, you know the one or two types you're working with, and just use those instead.
or use other templated library calls instead of writing your own.
 
Whether you use templates or not has nothing to do with whether you're writing an app or just a library.
 
Xeo
@MooingDuck Just click on the room name in the flag popup
 
@Xeo I didn't see one
@CatPlusPlus my libraries for fun are full of templates. My code at work does not contain the word template in it.
 
7:06 PM
Then you probably duplicate code.
 
Also my library has no templates, because there's no need.
 
@CatPlusPlus not that I can think of, because I used regular function calls
@CatPlusPlus I agree, not all Libraries need them. Many won't
@Xeo oops, I thought that was part of his name.
 
7:19 PM
Anyone have a suggestions for a starting language / framework if I want to get into shader programming? Ideally I'd like to start off by attempting a pixel shader to add a 'sharpen' effect to my desktop. (perhaps this is a better question for SO proper.)
I'm on nVidia hardware so I've been researching Cg, but perhaps it would be better to start with HLSL
 
Doesn't really matter. If you use OpenGL then GLSL, if DirectX then HLSL.
Adding effects to the desktop is unrelated matter.
And very OS-specific.
 
sbi
So userXXXXXXX has been trolling again, huh? And pissing off the puppy? And then @jalf, of all people, was suggesting a be-nice policy? @Dead: Just ignore this guy. I've been doing this for a long time now, and if you'd all just do this (and, thus, all stop responding to him), this room would be a much better place. @jalf: The guy might be beyond niceties. He's one of only three users I have blocked, I did this months ago, and he's still pissing off people.
6
 
@jalf It produces a segmentation fault on my Linux VM and MacOSX. This is my test. I hope my test is OK like this?
 
Ah, I just learned that I'm an Ignostic !
 
Ell
back again
 
7:25 PM
@JohannesSchaublitb **I**gnostic?
 
sbi
@JohannesSchaublitb Is that an agnostic that one should ignore?
 
@StackedCrooked yes?
@sbi nope!
 
@CatPlusPlus Why is modifying the desktop rendering unrelated... does it not use D3D or OGL?
 
Ell
@MooingDuck what I was saying was, I think a language would be good where you didn't have to specify template at all, the compiler just did it anyway
 
@JohannesSchaublitb Never heard of the term before.
 
sbi
7:25 PM
WordFriday: ignostic: person who believes question "Does God exist?" is meaningless without a coherent definition "God" http://is.gd/bplFHb
 
You can't exactly right-click the desktop and select "change shader", now can you?
 
sbi
litb follows Kevlin. Now he only has to learn that those are not real words.
 
Oh. Should have mentioned, I'd like to attempt under win7
 
@sbi why are they not real words?
 
@sbi Ignostic sounds like a pedant's religion.
 
7:27 PM
@Ell then how would you differentiate types?
 
sbi
@JohannesSchaublitb Because Kevlin posts made-up words on WF. Well, that's what I think, anyway.
 
Ell
@MooingDuck what do you mean?
 
DWM uses DX9, but then again, I don't think there's any way to plug custom shaders into that.
 
@CatPlusPlus Well no, but can't the shader be passed to the graphics driver?
 
@StackedCrooked It hardly sounds like a religion to me.
 
sbi
7:27 PM
@StackedCrooked :)
 
  template<class A, class B>
  void func(A a, B b) {
       A a2;  //without the template line, you can't do this
       B b2;
 
@sbi no, wikipedia knows about it too
about all words he presented so far, external sources know too
 
@robjb Well, have fun trying to find a way. Shaders themselves are rather simple.
Argh, CTAN, y u no work.
 
@CatPlusPlus Haha alright, thanks for the advice. I'll keep researching and see what I can come up with.
 
sbi
Today's identifier-naming advice: in the interests of completeness and politeness, I suggest spelling "count" as "count" and not as "cnt".
 
Ell
7:31 PM
@MooingDuck well every function would be a template function
 
sbi
Haha!
 
@Ell (1) then you'd have no (easy) way to restrict types (2) That'd devastate function overloading.
 
Ell
@MooingDuck good point about function overloading, but I don't see the need to restrict types?
if the type you are providing supports all of the operations in the function, it is good enough
 
@Ell not really… For example, I don't see why std::exception::what should be a template function.
If you don't want to restrict types, use PHP or JavaScript.
 
Ell
Well that isn't exactly what I mean and yeah I know I'm not planning this for C++, but rather for my own imaginary language :L
but for the record it would all be static and not done at runtime like php/javascript
 
7:35 PM
 number add3(number a) {return a+number(3);}
 int main() {std::string c = add3(std::string("HI"));}
your suggestion makes that compile and run
 
what's THIS
 
Who uses "cnt" for "count"? I guess only POSIX guys, they really don't like vowels.
 
Ell
@MooingDuck okay I see your point. In my mind I can get round this, but I can't put it into words. You will have to just trust me ;)
 
there is a screaming small child down the hallway...
 
7:37 PM
@Ell We can only wish.
 
@Collin he probably read some of my code…
 
Ell
hahaha
 
C++ will never be generic by default, because compatibility.
 
@Ell it also complicates compilation/linking
 
Ell
was it Ada that had runtime contracts (don't know what they are called) like specifying an integer that was between a given range?
 
7:38 PM
Hi all. I've just posted a question about RVO. I got an answer from Bo Persson and trust his opinion (I 've read quite a bit of his answers on SO), but I'm wondering if there is more advanced reading material on RVO.
 
Needs (C++)++ where the creators say, f compatibility
 
Ell
@MooingDuck why does it complicate linking/compiling?
 
I guess that was D
 
@Ell Factor has something like this, they call it predicate classes.
 
I don't really get how concepts work. I can't find anything useful on Google either, everything links to the proposal for the formal specification (which I'm not interested in).
 
Ell
7:39 PM
I will google :L
 
@Ell give me a sec, I can find a SO question about it I bet
 
@Ell Thought Ada had integers where you could specify the bit-width?
 
If you want a language with polymorphism by default and easy way to overload/restrict, Haskell!
 
@daknok_t it provides a duck-typed interface
 
Ell
@MooingDuck thank you :)
 
7:40 PM
38
Q: Why can templates only be implemented in the header file?

MainIDQuote from The C++ standard library: a tutorial and handbook: The only portable way of using templates at the moment is to implement them in header files by using inline functions. Why is this?

 
Ell
Haskell confuses me :L
 
@MooingDuck but how can I for example restrict a template parameter to only types that are LessThanComparable? static_assert?
 
Templates only complicate stuff in C++'s ancient compilation model.
@daknok_t SFINAE.
 
I'll look that up.
 
With concepts implemented, you can specify restrictions as part of the signature, and compiler does the rest.
Today it's enable_if and traits.
Alternative proposal is static if, in form of template <typename T> void f() if (less_than_comparable<T>::value) { ... } or something like that
 
7:43 PM
@daknok_t right now only with SFINAE/enable_if. If we had concepts, then concepts
 
Ell
The only complaint about c++s compilation model I have had so far is that in order to do cross platform classes (the way I like) is to either to CRTP which is a pain, or just have to repeat yourself in the header files
 
With concepts it was supposed to be template <LessThanComparable T> void f() { ... }
It's hardly the only way to get platform-specific implementation behind a platform-agnostic interface.
 
@Ell cross platform classes?
 
Ell
@MooingDuck that was worded badly - just cross platform in general
 
I use pure virtual interface, and substitute implementation with a build system.
That said, it's rarely actually needed.
 
7:44 PM
@Ell you don't need CRTP for that
 
Ell
a Window class, then X11Window, Win32Window, CocoaWindow etc.
@MooingDuck I know I don't but its the only way to avoid duplicating the public interface in the header code, but its not worth the hassle
unless I do something crazy like:
 
Either interface or Pimpl are better than playing with CRTP for this.
 
Ell
class CrossPlatform {
public:
int CrossPlatform
private:
#ifdef WIN
#include <windows_private_parts>
#endif
//etc
}
 
And if you don't mind including system headers, you don't really need that.
 
Ell
meh I kinda messed that up :L and I didn't like Pimpl either :L I don't like a lot of things :D
 
7:47 PM
#if defined WINDOWS
#include "window/windows.hpp"
#elif defined LINUX
#include "window/linux.hpp"
#endif
Where both headers have struct window.
 
@MooingDuck So if I want a function that takes a template parameter that's DefaultConstructible, I would do this?
template<class T>
typename std::enable_if<std::is_default_constructible<T>::value, T>::type foo() {
  // a static_assert looks nicer to me, and provides better error messages…
}
 
Ell
@CatPlusPlus yeah thats what I do now, I just don't like duplicating the public parts of the interface
 
What's "public parts of the interface"?
There's really nothing to duplicate between window creation on these platforms.
 
Ell
@CatPlusPlus the parts shared on all platforms
 
Such as?
 
Ah, whatever. I need to get on with this database project.
 
Ell
@CatPlusPlus I dont know for example the function void SetTitle(std::string new_title);
 
Which is a different call on X11 and Windows.
 
Ell
@CatPlusPlus I would have to write that a whopping 3 times for mac, windows and linux
 
@Ell just use the PImpl idiom, and give each OS it's own implementation file.
 
Ell
7:50 PM
@CatPlusPlus but when the class has private members, you cant just use a different implementation - they need private members so they cant all share the same header
 
Interface makes for a less boilerplate than PImpl, and the same amount of indirection.
 
@Ell there's no other option to defining the function three times, as all three are different calls
 
Ell
@MooingDuck yeah I guess :P
 
@CatPlusPlus true enough
 
@Ell You include a different class for each platform.
You can't have two implementations in the same build anyway.
 
Ell
7:51 PM
@CatPlusPlus yeah I know but it means i have to type the platform independant stuff 3 times. Maybe you arent getting my point - I might have to write a little demonstration
 
There's little platform-independent stuff in windowing.
 
Ell
@CatPlusPlus windowing is just an example :L but the fact that there is some at all means I need to either use Pimpl or seperate header files for each
 
@Ell You have to write it three times no matter what, in any language
 
Ell
@MooingDuck I have to write most of it 3 times, but I should only have to write the platform independant public interface of the class (e.g. void SetCaption(std::string newcaption); once
 
@Ell unless you find a library where someone else already wrote it three+ times for you.
 
7:56 PM
What are you reinventing, anyway?
 
@Ell there's easy ways to do that, via Pimpl or similar concepts
 
Ell
a basic windowing library that lets you make a window and get an opengl context. that is all.
@MooingDuck yeah :P I should use that >.<
but I'm a noob so leave me be ;)
 
@Ell Good luck with Mac OS X and Objective-C++.
 
@Ell So, you're reinventing my library. :P
 
Ell
@daknokt you can still use c++.....right? :O
@CatPlusPlus what is your library? :P show me :D
 
@Ell there's lots of libraries for that. Glut is the one I learned in school
 
@Ell yeah, but to create a window and an OpenGL context you need Cocoa, an Objective-C framework (unless you want to use that old 32-bit only piece of crap called Carbon).
 
GLUT sucks.
 
Ell
nah but eventually I will have re-invented SFML - but better
@MooingDuck yeah but glut is horrible
@daknokt aww man. Oh well i dont have a mac anyway XD
 
@Ell I can write it if you want. As long as you have the interface.
 
8:00 PM
I want!
 
sbi
In other news, I did a lot of digging today. I even broke a spade. And now I hurt again. All over.
Getting old is not for wimps.
 
Ell
@CatPlusPlus ughh I can't believe you're writing this too >.<
 
You're not paying attention to the chat.
 
@ScottW YES. It's the most crappy language ever. It's even more of a pain since you cannot have friend Objective-C methods which would make everything a lot easier.
 
I have a smaller scope currently, I only want a window with the context.
And events.
GLFW is terrible, too.
GLFW3 will be better, but it's in deep development.
Obj-C++ is C++ with Obj-C bolted on.
 
8:04 PM
@ScottW as long as you don't have to write any C++ wrappers around Objective-C classes it's fine. :P
@ScottW sure, except when you want to do Objective-C things (like creating a Cocoa window).
 
So, @daknokt, if you're bored and want to write this, I'll be happy to accept teh pull. ^_^
 
@CatPlusPlus I have a weekend of three days, followed by one school day, followed by a five day weekend. Of course I'm bored…
It's more fun than writing a crappy web framework in C++ like I'm doing now. xD
 
User-Defined Type.
 
Thanks.
 
8:08 PM
@Rob: User-Derfined Type.
 
What?
 
Ohh the chat is pinging the wrong rob again.
 
@Rob: just edited the question and title to clarify.
 
Funny, the highlight points to the correct message.
 
8:09 PM
I once did this horrible thing in Objective-C++ to prevent myself from writing a C++ wrapper around an Objective-C wrapper around a C++ class. ideone.com/yPTmq
 
Google says reliable UDP or Underwater Demolition Team.
 
Ell
glfw is C?
 
Yes.
@daknok_t That's so hacky.
 
Ell
:O i can't be doing with that
 
@CatPlusPlus: ironically, UDT is not in the list of acronyms ;-)
 
8:10 PM
It is.
Oh, it's not.
 
@CatPlusPlus but it made everything much easier to implement xD. I wish I could do friend @class MyObjectiveCClass or something.
 
@CatPlusPlus UDL is
"Internal Compiler Error" is where the code has an error in the compiler, or when the compiler itself has an error?
(probably second, just doublechecking)
 
The latter.
 
@CatPlusPlus neat, I don't find those very often
 
@MooingDuck: If the code has an error in the compiler, then it would be something like a syntax error, no?
 
8:13 PM
Try heavily templated code with Clang or GCC snapshots.
 
only time I recall was when I programmed arbitrary precision multiplication, and MSVC attempted to inline everything. Ran outta memory.
 
ICE is essentially what happens when the compiler gives up. :-)
 
Some people here get ICEs on regular basis.
 
I do, every time I use a lambda, or initializer list, or thread_local.
 
Not gives up, when it blows up internally.
"reached 100 errors on this line, giving up" is compiler giving up.
 
8:14 PM
@CatPlusPlus: Of course it's not meant to be taken literally
I used to get ICEs all the time when trying out TMP stuff on older compilers
 
"g++: segmentation fault" is ICE.
 
Ell
meh all these frameworks and languages suck compared to the ones I will write in my new programming language for my new operating system running on my new hardware that I designed :D
 
Well, most ICEs are more informative than segfault.
 
@CatPlusPlus how about out of memory? That's sorta fuzzy by your wording
 
I actually haven't ever had a compiler actually crash
 
8:15 PM
OOM is external condition.
 
@CatPlusPlus oh, fair enough
 
It's neither the fault of compiled code nor compiler.
And you can't really handle OOM.
 
Apple needs to fucking update Xcode with a clang version that doesn't suck.
 
@daknokt what's wrong with it?
 
Unless it's a mild case of OOM, and kernel didn't kill half of the system yet.
 
8:16 PM
@Insilico it crashes with lambdas, initializers lists, UDLs, thread_local
All segfaults, probably some old version of clang.
 
@CatPlusPlus: Generally speaking if you get an out of memory error on modern machines, something's gone seriously wrong
 
Next version has these (except possibly thread_local).
Well, you can still run out of address space in 32-bit processes.
Exhausting RAM happens, too.
 
@CatPlusPlus: True, but it's still an error you got to fix
Although to be fair determining a useful upper bound and enforcing it isn't that easy
 
@CatPlusPlus thread_local is currently called __thread in clang, and that does work ><
 
8:21 PM
I need CTAN and it doesn't work. Typical.
 
You're trying to update a TeX package?
 
No, get documentation.
Web interfaces on mirrors suck, I want main site. :.
 
@CatPlusPlus: Do you use an editor or an IDE-like thing specifically for TeX documents?
 
Ell
I have lost my graphics card box :'( it makes me sad
@CatPlusPlus shall we race to see who can create their version of the library first?
 
8:29 PM
@Ell What's so special about the box?
 
I don't really have time for it right now.
 
@Ell So get a different box?
 
Ell
@CatPlusPlus you are still taking part. It just means I will win.
@daknokt it has all the cables/splitters/etc.
 
Ah, well that sucks.
 
Ell
yeah -.-
 
8:30 PM
@Ell Oh, so you're looking for the stuff in the box
 
Ell
@Insilico yeah :L
 
@Ell Well, I already have basic functionality on Windows, and only events are missing from X11.
Apart from that there isn't much missing from original plan.
 
Ell
@CatPlusPlus yeah you will almost definately win. I have restarted this thing about 5 times no jokes - this is my problem, I simply don't finish anything
 
@Ell: This for a library?
 
Ell
@Insilico yeah
 
8:32 PM
Is it a general-purpose, "things-I-made-that-makes-my-life-easier" sort of library?
 
I even have tutorial written.
 
Or is there a specific application in mind?
 
Creating and handling events from OpenGL windows, as far as I'm concerned.
 
Ell
@Insilico it is just to make a window that you can grab an opengl context from
yeah, what CatPlusPlus said
 
Yeah, the libraries I've written fall more into the "things-I-made-that-makes-my-life-easier" category
It's not as polished as I like
 
Ell
8:34 PM
@Insilico this will be my first writing of anything at all fullstop
 
I probably spend way too much time thinking about its design though
 
while true; do inotifywait *.tex; make draft; done is cool.
 
@sbi hey, I can be nice! ;) And yeah, I've got the guy blocked too. But regardless of how annoying someone is, I don't agree with telling them to "fuck off" for asking questions.
 
@daknokt: Yup that's pretty much how it works. :-P
 
8:36 PM
@StackedCrooked aw bugger. Thanks for trying it out
 
@Insilico Same here…
 
Ell
if an std::string ends with a null-terminator, will getting rid of it do anything bad?
 
@jalf It's in the x64 read function or something.
 
@Ell: Besides breaking compatibility?
 
It's UB, probably.
 
8:38 PM
@Ell: As far as I know the c_str() function in it practically requires the string to be null-terminated
51
Q: Is string::c_str() no longer null terminated in C++11?

MankarseIn C++11 basic_string::c_str is defined to be exactly the same as basic_string::data, which is in turn defined to be exactly the same as *(begin() + n) and *(&*begin() + n) (when 0 <= n < size()). I cannot find anything that requires the string to always have a null character at its en...

 
Ell
Well when I do std::cout << "_" << mystr << "_" << std::endl there is a space between the last letter of mystr and the trailing _ when there shouldn't be and seeing as I'm dealing with win32 magic I assume its a null terminator but I don't know >.<
 
@StackedCrooked hmm, that really shouldn't do anything too crazy. Ah well, I'll keep digging then
 
@Insilico The pointer obtained from c_str() may only be treated as a pointer to a null-terminated character string if the string object does not contain other null characters.
 
So getting rid of the null terminator would make it not compliant with the C++11 standard
@Ell: Try trimming mystr and see if it makes a difference
I've never actually encountered the behavior you describe though
 
@StackedCrooked that function is just a simple wrapper because in 32-bit builds, I have to mess around with MMX registers to be able to atomically read 64-bit values. On x64 it should basically just be return *addr
ah well
 
8:42 PM
Sounds like a platform specific bug.
 
might be. Might be a completely general race condition I've just missed
 
Tin
hey guys, i'm getting familiar with random number generation using TR1. I defined a small template `struct`, which has as template parameters `engines` & `distributions`. Since, it's the first time I'm working with random number generators using TR1 and also passing arguments as template types, I was wondering if somebody could have a look at the following short script? http://ideone.com/vpcEu The code seems to be working, but I was wondering, if there are some improvements that could be done?
In IDEONE the code is not compiling, but in my MSVC10, everything runs fine.
 
Ell
is there a quick way in the standard lib to go from char to a hex string?
 
@Ell ostringstream with std::hex, maybe? Not sure if that works…
 
@KerrekSB Your comment here: stackoverflow.com/questions/10048435/…
 
Ell
8:45 PM
@daknokt I will check
 
@daknok_t yeah, that should work fine
 
Does it include smart pointers?
"Using pointers in C++ is generally a very bad idea." – Kerrek SB
 
Tin
@jalf, @CatPlusPlus, @StackedCrooked any suggestions maybe?
 
std::string foo(char c) {std::ostringstream stream; stream << std::hex << c; return stream.str(); }
 
Busy.
 
8:48 PM
@Andre no, he's not including smart pointers in that
 
@Tin at a glance it looks fine to me. You could consider adding default values for the template parameters, so it's easy to get a "default" generator with a regular uniform distribution?
 
@Ell this should work afaik.
std::string foo(const std::string& str) {
  std::ostringstream stream;
  stream << std::hex;
  for (char character : str) {
    stream << static_cast<int>(character);
  }
  return stream.str();
}
 
Factory function with deduction.
 
Tin
@jalf, great! good idea!
 
@Tin compiles in ideone too, but you had a runtime error.
 
Tin
8:50 PM
@MooingDuck, in my MSVC10, I didn't have any compilation errors and I didn't understand the IDEONE runtime error :S
do you might have any clue why does the runtime error ocurred?
 
@Tin I don't understand the error either, but that means it did compile and start to run.
 
@Ell you might want to change it to allow one to pass in iterators.
 
Ell
@daknokt the hex thing was just for debugging my mystery extra character problem so I don't think I need to support iterators
 
ah k
 
@Tin It seems to be that constructing of a random_device failed because it was given an invalid string to construct from, but you seem to only use the default. I'm baffled.
 
Ell
8:55 PM
why do we need to seperate dlls and objs - what is there in a dll that allows it to be dynamically loaded? what is missing from an objs? (This is the question I am googling atm :D just in case anyone knew the answer off the top of their head)
 
@Mooing How do you know?
 
@Andre because the exception was a std::runtime_error (which means an invalid variable/state happened), inside the function random_device::random_device(const std::string&) (The constructor for a random_device)
@Tin "std::mt19937 engine1(rd());" this line looks wrong to me. You're constructing a mt19937 from an unsigned int, when it's expecting a generator. Beats me how it compiled, but that possibly explains the/an error.
 
Tin
@MooingDuck, it's basically the example taken from here: en.cppreference.com/w/cpp/numeric/random/…
 

« first day (538 days earlier)      last day (4395 days later) »