Skip to main content
0 votes
1 answer
94 views

In this app I tried to implement SearchView.OnQueryTextListener in separate kotlin file like this import androidx.appcompat.widget.SearchView inline fun SearchView.OnQueryTextListener(crossinline ...
Dr Mido's user avatar
  • 2,966
2 votes
3 answers
384 views

Alright, so sometimes my "coding brain" skips a gear; once in a while you can hear the gears grind. (For instance, every once in a while I write class Foo : Bar {} before reminding myself that's not ...
John Price's user avatar
17 votes
3 answers
20k views

Is there any difference between operators and other methods to make inline in C++? I have searched for it, but it is not a common question, as I see. Has anyone a strong reason to use it or avoid? ...
JalalJaberi's user avatar
  • 2,687
0 votes
2 answers
201 views

This is what I'd like to do: string x = if(true) "String Val" else "No String Val"; Is that possible?
user259286's user avatar
  • 1,015
38 votes
3 answers
38k views

When I'm writing a simple (non-template) class, if the function implementation is provided "right in place", it's automatically treated as inline. class A { void InlinedFunction() { int a = 0; } ...
Yippie-Ki-Yay's user avatar
3 votes
3 answers
597 views

i'm writting handler for OpenGL texture and i'm thinking about safety and performance. Which level of optimization should remove marked if statements? struct Texture2D { GLuint ID; inline ...
kravemir's user avatar
  • 11.2k
0 votes
3 answers
264 views

Consider this code #include <iostream> #include <cstdio> using namespace std; class Dummy { public: Dummy(); }; inline Dummy::Dummy() { printf("Wow! :Dummy rocks\n"); } int ...
sud03r's user avatar
  • 20k
2 votes
1 answer
335 views

here is a small question about inline functions in c++. At what stage of the compilation in C++ are the inline functions actually inlined at the call? how does that basically work. lets say if the ...
Vijay's user avatar
  • 67.7k
0 votes
3 answers
783 views

I have repeating code in my work, and I want to get rid of it, so I know that in C++ it is not good idea to use macro, but instead I must use inline function, is it good idea to use this function as ...
helloWorld's user avatar
  • 3,099
33 votes
4 answers
22k views

I hope I worded the title of my question appropriately. In c# I can use lambdas (as delegates), or the older delegate syntax to do this: Func<string> fnHello = () => "hello"; Console....
Samuel Meacham's user avatar
15 votes
3 answers
809 views

As seen in this question: Raising C# events with an extension method - is it bad? I'm thinking of using this extension method to safely raise an event: public static void SafeRaise(this EventHandler ...
Jeff Cyr's user avatar
  • 4,864
2 votes
3 answers
643 views

I am looking for a trick in newer dotnets where I can use inline functions that return a string value. Here's what I have: var split = new[] { " " }; var words = SearchTextBox.Text.Trim().Split( ...
Matt's user avatar
  • 27.1k
7 votes
1 answer
2k views

I am not expecting a definite yes or no. Any knowledge you might have I will consider as an answer. private String CalculateCharge(Nullable<Decimal> bill, Nullable<Decimal> rate) { ...
ChaosPandion's user avatar
  • 78.4k
40 votes
8 answers
15k views

In C++ I can declare a method "inline" and the compiler is likely to inline it. As far as I understand there is no such keyword in Java. Inlining is done if the JVM decides to do so? Can I influence ...
CL23's user avatar
  • 766
0 votes
7 answers
2k views

I have an inline member function defined under class MyClass int MyClass::myInlineFunction(); This function is called from several places in my code. There are two ways to call this function Case 1: ...
sud03r's user avatar
  • 20k

15 30 50 per page