Questions tagged [inline]

Use this tag for questions specifically about the effects of the inline keyword, together with the appropriate language tag.

Inline, or inline expansion, is a programming language optimization that inserts the complete body of the function in every place that the function is called. Depending on the programming language, this may be implemented by the compiler, manually or by a keyword.

Historically, in the C and C++ programming languages, an inline function is a function upon which the compiler has been requested to perform inline expansion. In other words, the programmer has requested that the compiler insert the complete body of the function in every place that the function is called, rather than generating code to call the function in the one place it is defined. However, modern compilers usually use their own heuristics and ignore the request. Thus, the inline keyword is now mostly used for its effects on the One Definition Rule.

Inline expansion is used to eliminate the time overhead when a function is called. It is typically used for functions that execute frequently. It also has a space benefit for very small functions, and is an enabling transformation for other optimizations.

3753 questions
1
vote
1 answer

HTML / CSS h-tag and icons in one row (display: inline)

Good evening dear community, I am building one of my first HTML / CSS projects. I want to arrange a h-tag and three small icon (webp-data) in a row. What am I doing wrong? I have all four elements framed in a div and have formulated both for the div…
Simon
  • 21
  • 4
1
vote
0 answers

Why won't the links on the mobile version of a web page not stay in the ul width?

I'm studying this website and I noticed that on the mobile version of it the website isn't centered and some links are causing there to be a horizontal scroll rather than the rest of the link just going to the next line. How can I fix this? This is…
Maria
  • 11
  • 1
1
vote
0 answers

What is the purpose of the inline function modifier in HLSL?

According to Microsoft's documentation, [StorageClass is a] modifier that redefines a function declaration. inline is currently the only modifier value. The modifier value must be inline because it is also the default value. Therefore, a function…
Tezemi
  • 11
  • 1
1
vote
0 answers

Best way to access overflow flag (OF) from inline GCC C-function

I have the following function: struct sbi_i128_t { union { unsigned long long r[2]; unsigned __int128 i; }; }; /// Unsigned 128-bit integers addition with overflow indication. static inline sbi_i128_t sbi_addo_i128(sbi_i128_t a,…
Akon
  • 335
  • 1
  • 11
1
vote
2 answers

How to create constant space BETWEEN li inline list items

I want to use a list for horizontal links. I understand I need to use display: block for the ul and display: inline for the li. There are a number of questions for getting constant width for the li elements, but I want constant space between them,…
Alex Hadley
  • 2,125
  • 2
  • 28
  • 50
1
vote
3 answers

Inline output: Change small p-values to p < 0.001 in R Markdown

I have an object one that contains the results of a kruskal-wallis test. The p-value is really tiny i.e. 6.86e-09. Is there a way in inline code in R markdown to say p < 0.0001 instead of writing the exact p-value? one <- kruskal.test(Petal.Width ~…
MM1
  • 478
  • 15
1
vote
3 answers

display:block not working using media query

I'm working on an assignment using media queries, and encountered an issue when I try to make the navigation bar of my website vertical for smaller screens. I was expecting the each of the navigation links to take up a row, but instead they all stay…
Nishka S
  • 11
  • 1
1
vote
1 answer

Inline functions and pass by value to a function problem

I've searched for the definition of an inline function, and basically all sources provide this answer: "An inline function is one for which the compiler copies the code from the function definition directly into the code of the calling function…
1
vote
1 answer

Understanding why inlining function fixes runtime crash when collecting

I want to understand why inlining function fixes runtime error. The following code results in a runtime error (see bellow) [error] java.lang.ClassCastException: class Herbivore cannot be cast to class Food (Herbivore and Food are in unnamed module…
JoPoLu
  • 21
  • 2
1
vote
1 answer

How to a class with generics with an inline refied function

If I have a class like the following: class SimpleClass { var test: Int = 1 } I can do something like this: inline fun myFunction1(): T { //Do something with T } But if I have a class with generics: class…
ᴜsᴇʀ
  • 1,109
  • 2
  • 9
  • 23
1
vote
0 answers

How to create a single file with HTML, CSS and JS? inline

I work with Liferay and sometimes I need to build models.ftl, it's including put all the code in a single file. Is it possible to automate this process? I have already searched and the only way I found is to put script tag with src, not the script…
1
vote
1 answer

Kotlin inline functions in Interfaces

I'd like to have an interface and implementing class/object similar to the following: interface EventBus { suspend fun publish(message: T) suspend fun request(command: R):…
macnixde
  • 213
  • 1
  • 9
1
vote
1 answer

How to handle errors for inline functions inside an object

At the moment I've got this: const checkText = (t) => ({ isNotEmpty: function () { if (t.length === 0) { throw new Error("isNotEmpty false"); } return this; }, isEmail: function () { const emailRegex =…
mtoninelli
  • 686
  • 1
  • 6
  • 21
1
vote
1 answer

What optimization allows Functors to be inlined?

At compile-time, I want to pass a (stateless) function as efficiently as possible. I see two options: template bool PassAsArgument(int arg1, int arg2, Functor functor); and template bool…
mbang
  • 855
  • 2
  • 9
1
vote
1 answer

Can you make a list of value classes, with the list being bound to the list of values?

Since value classes (aka inline classes) are not classes at runtime but the value class, is it possible to make a list of them, and the list is bound to the list of values? If i couldn't explain that very clearly, here is a code example: class…
RGBCube
  • 82
  • 5
1 2 3
99
100