« first day (827 days earlier)      last day (4347 days later) » 

15:00
@FredOverflow I find it and rename it. What else would you do.
@R.MartinhoFernandes Alt+Shift+R in Eclipse. Changes all the call sites as well.
#define oldname newname
2
Also, crappy IDEs don't have refactoring support.
@FredOverflow Except those in templates.
Oh, I meant for Java. I have never tried Eclipse with C++.
Write better code instead of refactoring it over and over again
15:01
Personally, I think refactoring is extremely important in non-toy projects.
@FredOverflow I don't like the idea of hiding away breaking changes.
Why would they be breaking?
Renaming something in the public interface is a breaking change.
Oh, you mean to call sites not available to you? Yeah, it only works if its inside some project.
Why are you renaming methods anyway
15:02
Refactoring java.lang.equals to java.lang.equalsSucks would probably not be a good idea ;)
I rename methods when I am designing them.
@CatPlusPlus Because someday, you'll come up with a better name.
Using Java is the bad idea
Which means there aren't more than couple usages.
@FredOverflow Make a new one and deprecate the old one
15:03
That's how manual refactoring works, more or less.
@CatPlusPlus Have you never been in the situation where you wanted to rename a method?
26 secs ago, by Cat Plus Plus
@FredOverflow Make a new one and deprecate the old one
Unless it's a very internal class or something
But then again the name doesn't matter that much in that case
Don't break APIs scrubs
Goood Eeeeveniiiin'.
Anyway, crappy IDEs don't have refactoring support, so the point is moot.
@CatPlusPlus int bob, fred, jane = detail::fizzbuzz();
@ThePhD Good evilin'
15:05
@Potatoswatter Why am I not initialized? :(
We're not talking about names that are completely wrong
@R.MartinhoFernandes Or they rename half of the occurrences.
Because those shouldn't get past the design phase
@StackedCrooked And most certainly don't consider templates.
@CatPlusPlus API breaking? We're all writing new and forever unfinished projects here.
15:06
Hey, I don't write new and forever unfinished projects. :c
@FredOverflow int fred is always a self-starter, no need.
C++ is too fucked up for me to trust mass automated refactorings. :(
@rubenvb Doesn't matter
DON'T BREAK APIS
Btw, how do you do any refactoring in C++ in Visual Studio without VAX?
Also, uh.
15:06
@R.MartinhoFernandes C++ is too fucked up for me to trust anything.
template<typename T> void foo(T t) { t.bar(); } // try renaming bar with the IDE :)
@R.MartinhoFernandes I have no idea, I don't write large stuff in C++.
Anyone here use Sublime Text 2 in any kind of depth?
@StackedCrooked Well, the IDE could still try to find all call sites, right?
Given the way that IntelliSense "works", the idea of mass refactorings in VS really scares me.
15:07
I'm trying to create a Build System for it that takes a list of source files and include files and compiles them, but Sublime Text 2's JSON seems.. .... grossly primitive.
@ThePhD I use it in the following way: paste, Replace Tabs with Spaces, Copy :)
@FredOverflow Call sites of what
@FredOverflow How? By grepping?
Yes, my text editor can grep.
There is zero type information in templates.
@CatPlusPlus Somewhere in the code, someone wrote foo(x), didn't he?
@FredOverflow Yeah. But maybe not all types that should work with foo are used in this particular program. So the IDE won't know that their 'bar' methods also need to be renamed.
15:08
Which is the same amount of type information grep has.
0
A: C - Default variable type

Clark GaebelYes. /thisneedstobethirtycharacterslong

^^ I tried to comment out the second part.
It didn't let me.
I guess at some point in the last few months, they stopped counting comments in the minimum length counter.
@Mysticial Use the invisibles.
There's three question marks in the OP.
@rubenvb That bastard!
Puttin three question marks in his question.
@FredOverflow Yeah, and what if that is meant to ADL?
15:10
... You know what?
Do you really want to rename it blindly?
I'm going to make GCC work in Visual Studio, and get error message redirection, myself.
Fuck Sublime Text 2. Let's do this.
@ThePhD good luck with that.
@R.MartinhoFernandes No, I'm just saying that it should be possible. If a compiler can tell when a template function is being called, why shouldn't a refactoring tool be able to tell?
Don't forget to translate all the commandline arguments hardcoded in the project files.
And gdb integration.
15:11
Eh.
@FredOverflow Because you can have calls that look like they are calls of that function but aren't.
Think about it: if I use Sublime Text 2 or Vim, I don't have GDB integration anyways.
Just put a call in a template.
Why does std::unordered_set::insert return a pair<const_iterator, bool>?
I'm not losing anything if I just use VS as a text editor, and get it to support GCC's error output.
15:12
You may not want to change the call in the template.
@rubenvb You don't have to do that
Use makefile project and external build system jesus
-3
A: C - Default variable type

Clark Gaebelif ((1/3) > 0) puts("yes"); if ((1.0/3) > 0) puts("yes");

You only have to change the format of error messages
I totally mutilated that answer lol. But my intentions were good!
The type with the function you are renaming may have never meant to be used with that template.
There is no way for the refactoring tool to know that unless you tell it.
15:13
@R.MartinhoFernandes Again, the compiler can decide that. So could any other tool.
Refactoring tool could do what compiler does
And now you are reducing it to a glorified grep and ask.
I need a language that can do massive text processing....
@FredOverflow No, it cannot.
... Maybe PERL?
15:13
damn, I can’t implement std::numeric_limits for my bounded_natural since the constructor isn’t constexpr
If you want any refactoring to take half an hour in large projects
@R.MartinhoFernandes So how does the compiler decide if something calls the template or not?
I do use the QtCreator's refactoring tool, with varying success.
@CatPlusPlus If a compiler takes that long to refactor it, how long would it take to do manually?
@FredOverflow The compiler has more information: it knows nothing else will be written. The program is to work as is.
15:15
0
A: GCC Fail? Or Undefined Behavior?

vonbrandPlease people, undefined behaviour is exactly that, undefined. It means that anything could happen. In practice (as in this case), the compiler is free to assume it won't be called upon, and do whatever it pleases if that could make the code faster/smaller. What happens with code that should't ru...

^^ I think this guy completely missed the point of the question...
template <typename T>
struct foo {
    void f() { T().bar(); }
};
struct not_meant_for_fooing_just_happens_to_have_a_function_named_bar_as_well {
    void bar() {};
}
@R.MartinhoFernandes At refactoring time, nothing else is written as well.
not_menant_for_fooing_just_happens I can't even type that all out I wanted code completion so bad. :c
Now rename not_meant_for_fooing_just_happens_to_have_a_function_named_bar_as_well::bar and tell me if the tool should change foo::f.
If there is no connection in the code, no.
15:16
How the fuck will the tool know if I want or not to change my template?
@R.MartinhoFernandes it doesn't, so it leaves it alone. That's manual post-refactor refactoring
@FredOverflow The connection could be somewhere else.
It could be somewhere else, but not in the code?
@FredOverflow In code that will be written later.
@rubenvb Yeah, thank you very much for your glorified grep.
Sure, tools can't look into the future :)
15:17
Guuis, tooling question.
user142019
Use Vim and GHC.
What program / language can I use to do a massive regex fapfest on command line / stdin ?
@Zoidberg =l
Perl? :)
I can't do T& bla = *(some_std_set_T.insert(someT).first); Why?
user142019
@ThePhD Perl or sed.
15:18
template <typename T>
struct foo {
    void f() { T().bar(); }
};
struct meant_for_fooing {
    void bar() {};
}
@ThePhD fapfest?
The point is that there is no difference between these two examples for a tool.
But there is for a human.
@rubenvb Error message?
Clang says it is dropping qualifiers on conversion, which means first is const_iterator.
Oh yeah, set elements are always const.
15:19
I wonder if I have a sed dist on my windows...
Names matter when renaming. Who would have thought.
Ah fack.
@R.MartinhoFernandes You could just keep a catalogue of everything that's been templated-instantiated with foo thus far.
Just use const T& or auto&, what's the problem?
that must be the third time I've run into that.
I need to modify the item.
15:20
That way you only rename what has been used with it.
But it won't affect the ordering in the set.
That's about as safe as a tool could get, right?
So mutable it is.
@rubenvb You cannot modify associative containers from the outside.
@ThePhD Nope. I could be shipping two (related or unrelated) types that the user will use to instantiate himself.
15:21
@R.MartinhoFernandes Will Concepts solve the "problem"?
@StackedCrooked Uh. Like a template metawank or something.
@FredOverflow I can modify enough by using mutable.
@ThePhD In the past I tended to write little Ruby scripts for non-trivial find/replace jobs. Now I usually use a combination of find, grep and sed.
@FredOverflow Maybe. Maybe not. If "this type models this concept" has to be specified explicity, then yes, it helps. Otherwise, no.
which is evil and all, but heck. I need uniquity and editability.
15:22
@R.MartinhoFernandes Well then you'll just have to do renames yourself. I mean, you can't expect a tool to divine which things should be used with foo if you never use them with foo.
@ThePhD And also, a refactoring tool has to work with code that is being written, not only with code that is ready to ship.
@ThePhD But VS also supports basic find/replace with regex. It might suffice.
@ThePhD That's my point. A mass renaming tool in C++ is a glorified grep.
Oh.
Well then we see eye-to-eye.
hmpf. No constexpr integral_type std::log()
15:23
OH MY GOD I have the same opinion as the ROBOT>
Oh bby~
@StackedCrooked I'm going to be manipulation the output from g++.exe from the command line. My idea was to write a tool - in whatever language - to make g++ output look like cl.exe output.
sed/grep are looking like the top ompetitors, but it might get stuffy trying to write a sed script for this...
@ThePhD Then you need sed.
Guys, I just found a subtle hint to the removal of Concepts in the C++ standard. It is an enum value called broken_promise lol (30.6.1 §1 in the current draft)
@rubenvb Is that well-defined?
OOH, hey.
Are concepts planned for a future standard. Or are they really dead?
Somebody has already done what I want in perl.
Now I just have to convert it to SED, since I don't have perl.
15:26
@StackedCrooked Bjarne is still working on that with a graduate student and other people. Concepts are much simpler now.
@FredOverflow I guess as long as the mutable members aren't involved in operator< (or operator== and std::hash) there must be no problem.
Yeah, that's fine.
4
Q: Is this safe - mutability and sets

MegatronI was curious as to whether the following scenario is safe. I have the following class definitions: class ActiveStatusEffect { public: StatusEffect* effect; mutable int ReminaingTurns; ActiveStatusEffect() : ReminaingTurns(0) { } //Other unimportant stuff down here } I...

Thought so. I brought this up before, when I first learned this trick.
15:31
OOH
I know!!
I'll write a vg++.exe, for Visual Studio G++.
I will invoke g++ inside of it and then parse the command line output I get.
It will take the same arguments as g++ and just pass them on.
oh god.
Can’t I shadow namespace functions with static member functions?
@ThePhD Then how will it be different to g++.exe with a different name?
15:36
I try to specialise std::numeric_limits and since I need a constexpr log function, I’ve defined is as a static member of my specialisation …
@DeadMG He's planning on changing the output to fit VS's.
Vim has support for different output formats builtin.
Yes, VIM is glorious, I understand this.
Then use it
But this seems like it would be fun.
You have a weird definition of fun
15:38
Qt Creator also has support for Clang, MSVS, Intel, and GCC.
If I can make this work...
I can have VS intellisense and VAX support for my GCC code, I think.
lol, IntelliSense.
Obviously no GBD, that'd be a lot harder and really out of the scope of my knowledge.
@ThePhD and a spurious waste of duplication effort
Someone's already integrated GDB into VS?
> Buy now
I won't vouch for it though :)
No ty.
why would anyone using gdb want to integrate it into VS?
Free tool <-> expensive tool including a better version of the free tool.
You've... lost me.
15:48
I think he is either crazy or saying that the VS debbugger sucks.
Why would someone using gdb, and hence a bunch of free compilers and linkers, want to use them in VS?
There's loads of free IDEs which fit your needs.
eclipse, netbeans, codeblocks, qtcreator, you name it.
all with nice visual debugger.
and error message to source file linking.
I've decided not to use Code::Blocks as a project editor, or Eclipse, or Netbeans.
Sublime Text 2 was a good text editor, but it's support for building / projecting was extremely primitive, like a baby VIM or something with JSON.
What is your build system?
0
Q: Dafuq is the mistake :(?

Lennart Schochi just started programming a little password manager but every time i run it in the emulator, it crashes and i get the following error: "android.widget.TextView cannot be cast to android.widget.EditText". Is everyone seeing the mistake? MainActivity.java: package de.lennartschoch.passwordmanage...

VS is what I'm fairly comfortable with. I did use Code::Blocks for a time but it slowly and surely pissed me off.
15:52
Or do you not care?
Well, I am going to be doing Linux development soon, so I wanted to have a system that A) would allow me to specify multiple files to compile on a single 'Build' invocation and B) link in various libraries and include directories from a predefined list by default.
@Mysticial Probably a guy named lennart schoch lol
What the hell!
@ThePhD well, that fits pretty much everything except VS.
#include <limits>

int main() {
    int const& x = std::numeric_limits<int>::digits;
}
15:53
VS, Code::Blocks, Eclipse, and Netbeans do all of that. Sublime Text 2 cannot (unless you hardcode what you want, which means you have to do it per project, which is a waste).
Why can I take a reference here?
@KonradRudolph because temps bind to const refs?
and constexpr definitely do so?
@rubenvb Hm, damn, inadequate example. My point is that the variable is defined, not only declared
at least I’m inferring this from a slightly more complex use case
that confuses me … why would it be defined?
And more to the point: is this required when specialising std::numeric_limits?
huh? It's constexpr. That means the definition needs to be known. A definition is a declaration.
@rubenvb No
15:57
I don't know what you're asking.
constexpr only needs an initialisation, not a definition
struct foo { static constexpr X = 10; }; // X is not defined.
@KonradRudolph C++03 18.2.1/3 For all members declared static const in the numeric_limits template, specializations shall define these values in such a way that they are usable as integral constant expressions.
Guys! Pancakes with apple sauce, so awesome!
Can only chat for like 10 seconds, must go back to kitchen :)
Okay, lemme update my example
@FredOverflow Potato pancakes…
15:59
@Potatoswatter As a matter of fact, I did put three potatoes in there! Are you a mind reader?
@FredOverflow Pancake awesome metric = |apples| * |potatoes|
elementary deduction
Blasted, why does the code work on Coliru but not locally?
lol
cause you need to use Clang to show you what's wrong.
@rubenvb coliru uses clang? I thought it used g++
Damn, the number of GCC problems I’ve stumbled across in the the last 24 hours is astounding
No, you need to use Clang instead of GCC to get a readable and to the point error message.
Clang 3.2 > GCC 4.7.2 when it comes to error messages.
16:09
@rubenvb How does that help me in this case? The problem is that two identical versions of GCC (assuming Coliru uses GCC 4.7.2) produce different behaviour
I.e. am I allowed to take the address here?
Who'd be up for Civ5 after I get back from drinking
'round midnight probably
@R.MartinhoFernandes @EtiennedeMartel
@KonradRudolph I get an undefined reference to std::numeric_limits<X<8ull> >::digits
GCC 4.7.2.
@rubenvb Yes, me too :/ And it ruins my day :(
More interesting still, remove the N template argument and substitute it by a integral constant in the digits initialisation, then you’ll get a compile error
@Zoidberg for wildly varying values of "work"
LiveWorkSpace also accepts it …
different code...?
huh, GCC 4.7.2 on LWS is also ok, Clang 3.2 has undefined reference.
@KonradRudolph Possibly, yes. Depends on the exact meaning of 'odr-use'.
GCC 4.6.3 is also fine.
nope, gcc 4.7.2 here gives undef reference
16:15
or wrong.
I believe Clang is correct, except that it should get TWO undefined references
@LucDanton Okay, but at least it should be consistent for X<8> and int, right?
@KonradRudolph As a matter of QoI. Conformance, no.
because it isn’t on my local GCC 4.7.2, and neither is it on LWS’ clang 3.2
@LucDanton Well. But conformance does depend on the meaning of odr-use, doesn’t it? And I thought C++11 had that clarified one way or another …
@KonradRudolph I don't recall. As I remember it there's always been a lot of leeway as to QoI.
@KonradRudolph are you on Windows?
16:22
@rubenvb Never
Quuick question
That's weird.
With g++, is it possible to change the working directory using an option?
Then online compilers must be doing something we're not.
Or do I have to do a cd before I get there?
16:23
@ThePhD well, yes.
Hm. Well, hokay.
Thanks.
Qt5 is huge.
@rubenvb ...pile of ...?
@Abyx Give me one decent alternative that fits the same purpose, feature-set and look, and I'll finish that sentence for you.
@rubenvb dunno. I don't write cross-platform GUI
16:35
It's a lot more than that.
argh, I forgot: static C array subscript isn’t constexpr, right?
@CatPlusPlus Sure, but keep in mind those games are loooong.
vg++ is ALIVE!
Now I just need a short unix -> long windows conversion function,
and I will have G++ IN MY GRASP.
does his evil know no bounds?
16:38
Who's evil? :o
@ThePhD Hitler, obviously.
Ah.
16:57
I guess it's not that easy to earn tlib's undownvotes... :(
@Potatoswatter What else do you put potatoes in?

« first day (827 days earlier)      last day (4347 days later) »