Fact-checked by Grok 2 weeks ago

Void type

The in is an incomplete type that comprises an of values and cannot be completed or used to declare objects of that type. It serves primarily to indicate the absence of a return value in declarations and to form pointers capable of referencing any object type without loss of . Introduced in the original standard (ISO/IEC 9899:1990) as a way to explicitly denote s that perform actions without returning data—analogous to procedures in languages like Pascal—the void type has become a cornerstone of C's . In declarators, specifying void as the return type, as in void print_message(void), signals that the executes for side effects only, such as output or state modification, and any return statement within it omits a value. Similarly, void in a parameter list, like int func(void), explicitly declares a with no arguments, distinguishing it from an unspecified parameter list in older C dialects. A key application of the void type is in pointers, where void* acts as a pointer type convertible to or from any object pointer type, facilitating dynamic allocation and polymorphic arguments without type-specific . For instance, functions like malloc return void* to allocate untyped blocks, which must be cast to the appropriate type before use, and memcpy employs void* for source and destination buffers to handle arbitrary data. Void pointers share the representation and alignment requirements of pointers, ensuring compatibility across types, but they cannot be directly dereferenced and require explicit . The void type's design promotes portability and efficiency in C programs, as outlined in subsequent standards like ISO/IEC 9899:2011 and the current ISO/IEC 9899:2024, where it remains unchanged in core semantics while supporting advanced features like operations and fencing via void-returning functions. This concept has been inherited by C-derived languages: in C++, void functions and pointers function identically, with additional template support for , as specified in ISO/IEC 14882. In C#, void denotes methods without return values, emphasizing action-oriented code. Overall, the void type underscores a of explicit and minimalism, enabling low-level control while avoiding unnecessary overhead.

Overview

Definition and purpose

The void type in programming languages denotes the absence of a value or an empty result set, serving as a construct to represent operations that produce no computable output. It has no values and no associated operations, effectively signaling the lack of a altogether. This type is fundamentally used for procedures or functions that execute side effects—such as , state modifications, or resource allocations—without needing to return data to the caller. The primary usage of the void type occurs as the return type in declarations, indicating that the performs its intended task but yields no returnable result. For instance, in generic , a might be specified as void outputData();, where the handles display or without producing a value for further computation. This convention allows programmers to explicitly mark functions designed for effects rather than evaluation, promoting clarity in code design and preventing misuse in expressions. Void functions return to the caller automatically upon completion, often without an explicit , though one may be used solely for flow . Conceptually, the void type embodies "absence" within a , standing in contrast to types that carry meaningful like numbers or objects. It facilitates type-safe programming by enabling compilers to enforce that non-returning operations are not treated as value providers, thus avoiding errors in languages with static typing. For example, a print declared as void print([String](/page/String) message) would output the message to a console but reject any attempt to assign its "result" to a . This role underscores void's utility in distinguishing imperative actions from value-producing computations, though it differs from the unit type, which represents a with a trivial .

Historical origins

The concept of the void type traces its origins to , where the VOID mode was introduced in the 1968 revised report to specify procedures that return no value, distinguishing them from functions that produce results and enabling explicit handling of side-effect-only operations. This construct provided a foundational mechanism for denoting the absence of a return value in , influencing the design of later imperative languages by emphasizing in procedure declarations. The void type was adopted in during its development at Bell Laboratories in the late 1970s, appearing in the C compiler released in 1979 to explicitly indicate functions with no return value, replacing the earlier implicit int return convention that assumed all functions returned an . This addition improved code clarity and type checking in system programming contexts, such as Unix development, and was further refined in subsequent implementations around 1980. The feature was formalized in the standard (ISO/IEC 9899:1989), which mandated void as the return type for non-returning functions and extended its use to parameter lists for specifying no arguments. C++ inherited the void type directly from C as part of its foundational compatibility, with early implementations in the late 1970s and 1980s using it to denote non-returning functions and generic pointers. Enhancements came through evolving standards, including stricter typing rules in C++98 that aligned void with C's semantics while integrating it into object-oriented features, and further developments in C++11 that supported void in variadic templates and lambda expressions for more flexible generic programming. These changes allowed void to play a role in modern C++'s template metaprogramming without altering its core meaning as an incomplete type. The void type's influence extended to other languages through C's widespread adoption; Java incorporated void in its 1.0 release in 1995 as the return type for methods performing actions without producing values, directly drawing from C's syntax to simplify imperative programming in an object-oriented environment. Similarly, C# adopted void upon its introduction in 2000 by Microsoft, using it for methods with no return value while inheriting C's conventions to ensure familiarity for developers transitioning from systems programming. In functional programming languages like Haskell (developed in the early 1990s), the concept of an empty type—analogous to void—has been present since its inception through algebraic data types, facilitating proofs and total functions in lazy evaluation contexts; a standard Void type was added in 2015. Key milestones in the void type's development include clarifications in recent standards: the C23 standard (ISO/IEC 9899:2024) explicitly equates empty parameter lists like f() with f(void) to mean no arguments, resolving ambiguities in legacy code and promoting portable declarations. Likewise, refined void's usage in parameter lists through harmonization with C standards, enhancing compatibility in mixed-language environments and supporting deducing-this features for generic member functions.

Void as a return type

In C-family languages

In C-family languages, the void keyword serves as the return type for functions and methods that perform operations without producing a usable value for the caller. A declaration such as void f(); indicates that the function f executes a but returns nothing, allowing the [return](/page/Return); statement to simply terminate execution without an . Reaching the end of such a function's body is semantically equivalent to an implicit [return](/page/Return);, ensuring controlled flow without . For parameter lists, the explicit form void f(void); declares a with zero arguments, enabling compile-time verification of calls. In C23 (ISO/IEC 9899:2024) and later, void f(); also declares a with zero arguments. Prior to C23, this form originated from pre-standard K&R C and implied an unspecified number of parameters, potentially leading to type mismatches at . This precision in prototypes promotes safer code by enforcing argument compatibility. Calls to void-returning functions form expressions of type void, permissible in syntactic contexts requiring expressions (e.g., within a comma operator like (side_effect(), f());), but their lack of value prohibits usage in value-dependent operations, such as assignments (int x = f();) or conditional contexts expecting a scalar result. Compilers strictly enforce these rules: attempting to return a non-void expression from a void function (e.g., return 42;) or treating a void expression as having a value triggers diagnostic errors, preventing invalid code from compiling. This enforcement aligns with language standards to maintain type safety in procedural programming. These conventions remain consistent across C, Objective-C, and C++, particularly in procedural contexts, where Objective-C methods follow analogous syntax like - (void)methodName;, inheriting C's behavior for non-value-returning actions.

In object-oriented languages

In object-oriented languages, the void return type is employed for methods that execute actions such as modifying object state or generating side effects, without producing a computable result to return. Instance methods like setters, which update an object's internal fields, or utility methods that output data to streams, typically specify void to indicate no value is yielded upon completion. This design supports the encapsulation principle by allowing methods to focus on imperative operations within class boundaries. Void integrates seamlessly with core object-oriented features, particularly and polymorphism. In , a subclass must preserve the void return type of the overridden superclass method to maintain substitutability and avoid type mismatches during dispatch. For instance, in a , a base might define public void update(Object o) for state modification, which a derived class overrides with the same to customize while adhering to the . Generics in these languages treat void as a non-reifiable keyword unsuitable for type parameters, though reference types like Java's Void class enable void-like placeholders in generic declarations, such as Callable<Void>. Error handling in void methods diverges from value-returning ones by leveraging exceptions as the primary mechanism, rather than optional return codes. This aligns with object-oriented exception hierarchies, where methods throw derived exception types to propagate errors up the call stack, ensuring robust without altering the method's non-returning semantics. For example, a void initialization method might throw an IllegalArgumentException if preconditions fail, prompting callers to handle it via try-catch blocks. The void return type was formalized in early object-oriented languages, appearing in 1.0 released in 1996 as a fundamental keyword for non-returning methods, and in C# 1.0 launched in 2002 with identical semantics inherited from C-family influences. Subsequent versions of both languages have retained this specification without substantive modifications, underscoring its stability in supporting procedural aspects within object-oriented paradigms.

Void in type theory and functional programming

As an empty type

In , the void type is conceptualized as an empty type, characterized by having no values or constructors, which formally encodes impossibility or non-termination in computational terms. This uninhabited nature distinguishes it from other types, as it contains zero elements, often interpreted semantically as the . Semantically, the void type functions as the bottom type, denoted \bot, serving as the least element in type hierarchies and representing falsum or under the Curry-Howard . It plays a crucial role in proofs, particularly in handling impossible branches during or exhaustive case analysis, where deriving a value of type \bot signals an inconsistency. For instance, in , a P is negated as P \to \bot, meaning any purported proof of P leads to . The void type facilitates key proof applications, such as enabling exhaustive case analysis by treating cases that cannot occur as yielding \bot, from which any conclusion follows via the principle of (ex falso quodlibet). Notably, functions from the void type to any other type C are total and unique, as the absence of inputs ensures vacuous satisfaction of totality; this is captured by the elimination rule providing a unique \bot \to C. In formal contrasts, the void type has zero, unlike inhabited types with at least one element, making it invaluable in category-theoretic interpretations where it serves as the initial object—possessing a unique to every other object in the of types. This initial object property underscores its role as the colimit of the empty diagram, reinforcing its empty semantics. As the conceptual opposite of type, which has exactly one inhabitant, the void type emphasizes absence rather than presence. In practical implementations within languages supporting advanced type systems, the void type manifests as unreachable code paths, indicating impossible execution branches, or as handlers for crashes and exceptions where no valid exists.

Relation to unit type

In , the unit type is a singleton type inhabited by exactly one value, typically denoted as () or ?, which signifies the presence of a without conveying additional , such as the successful completion of a . This type serves as the terminal object in categorical semantics, allowing functions that produce no informative result to still participate uniformly in type systems supporting higher-order functions and composition. The void type differs fundamentally as an empty type with no inhabitants, embodying impossibility or falsehood in logical interpretations, where no term can be constructed to satisfy it. Despite this theoretical emptiness, void is frequently used in practice—particularly as a function return type in imperative languages—to indicate that no value is returned while the function terminates normally, effectively aliasing the semantics of a unit type by preserving control flow without data. This overlap arises because a void-returning function implicitly "returns" the single implicit unit of success, though it lacks an explicit value for manipulation. In C-family languages, void approximates for return types, enabling procedures like I/O operations to signal completion without values, as in void printMessage() { /* side effects */ }, where the absence of a statement conveys "done" implicitly. Functional languages maintain the distinction more rigorously: Haskell's () type allows explicit returns for composable actions, as in printMessage :: IO (), contrasting with the uninhabited Void for non-terminating or impossible computations. This interchangeability highlights how void often collapses into unit-like behavior for practical returns, despite their distinct cardinalities (zero vs. one inhabitant). Language designers weigh trade-offs between these types based on paradigm: imperative systems favor void for its conceptual simplicity and efficiency, avoiding the overhead of constructing a singleton value in low-level code. Functional paradigms embrace unit for expressiveness, enabling generic programming patterns like mapping over unit-typed results and preserving type uniformity in curried functions, as seen in category-theoretic alignments where unit facilitates products and exponents. Pseudocode Example: Unit Return for "Done"
function logEvent(message: String): Unit {
    writeToLog(message);
    return ();  // Explicit singleton, composable in higher-order contexts
}
Pseudocode Example: Void for "Nothing"
void logEvent(String message) {
    writeToLog(message);
    // Implicit completion, no value constructible
}

Void pointers and generic typing

In C and C++

In C and C++, the void* type serves as a pointer capable of pointing to any object of any incomplete or object type without loss of information, facilitating flexible data handling in scenarios like dynamic memory allocation and functions. This design allows void* to act as a universal pointer type, but it cannot point to functions, bit-fields, or objects with class, and dereferencing it directly is invalid since void is an incomplete type. The syntax for declaring a void* is straightforward, such as void *ptr;, and it supports implicit assignment from any pointer to an object type . For example, given an int var = 42;, one can assign ptr = &var; without a cast, as the standard permits conversion of any object pointer to void* and back, yielding an equal pointer value. However, to dereference or access the pointed-to data, an explicit cast to the appropriate type is required, such as int *iptr = (int *)ptr; *iptr = 10;, ensuring during operations. Pointer arithmetic is explicitly disallowed on void* in both C and C++ to prevent unsafe operations, as the size of the pointed-to type is unknown; unlike typed pointers (e.g., ), adding an to a void* results in . To perform arithmetic, the pointer must first be cast to a typed pointer, such as , where the size is defined (typically 1 byte). In C, void* plays a central role in functions for , such as malloc, calloc, and realloc, which return void* to provide generically usable allocated space aligned for any object type. Implicit conversions are allowed here, so the returned pointer can be assigned directly to a typed pointer in most contexts, though casting is recommended for clarity; for instance, int *arr = malloc(5 * sizeof([int](/page/INT))); works without explicit cast due to rules. C++ builds on C's void* but enforces stricter , requiring explicit s for conversions involving void* to avoid implicit . The preferred mechanism is static_cast<void*>, as in void *ptr = static_cast<void*>(&var);, which safely converts from any object pointer to void*, while converting back to a specific type (e.g., int*) also demands an explicit like static_cast<int*>(ptr). This integrates with C++ templates for , where void* can serve as a type-erased in non-templated contexts, though templates themselves avoid void* by parameterizing over actual types for compile-time safety. The use of void* introduces safety risks, primarily due to the lack of compile-time type checking, which can lead to type mismatches if casts are incorrect, resulting in such as misaligned access or invalid memory reads. In early implementations, this flexibility contributed to historical bugs, including alignment violations where converting to void* and back to a stricter-aligned type caused runtime errors, as the standard leaves such cases .

In other languages

In , the std::ffi::c_void type provides an equivalent to C's void specifically for pointer contexts during (FFI) interoperability, where *const c_void corresponds to C's const void* and *mut c_void to void*. Unlike C, Rust lacks a native void* pointer and instead enforces its use within the language's ownership and borrowing system, which prevents common memory errors like dangling pointers or data races through compile-time checks. Go employs unsafe.Pointer as a generic pointer type that mirrors the flexibility of C's void*, enabling conversions to and from any other pointer type or even uintptr for low-level operations such as system calls. However, its application is confined to unsafe code blocks, where the compiler's type safety and garbage collection protections are explicitly disabled, requiring programmers to manage runtime risks manually. The D programming language retains void* directly from its C heritage, allowing it to point to any data type without size assumptions, while introducing const-correctness to preserve immutability where specified. To promote safety, D uses the @system attribute on declarations involving void* or other raw pointers, signaling to the compiler that such code may involve unchecked operations and thus restricting its integration with @safe (memory-safe) functions unless explicitly allowed. Across these languages, common adaptations to void-like pointers emphasize explicit type casts before dereferencing—such as converting unsafe.Pointer back to a typed pointer in Go—and integrate bounds checking or ownership validation to reduce the potential for buffer overflows or invalid accesses inherent in C-style usage. For instance, Rust's borrowing rules mandate that pointers remain valid only within defined scopes, while D's attributes enable selective safety auditing. A key limitation of void-like constructs is their inherent unsafety in low-level contexts, prompting many modern languages to forgo them entirely in favor of parameterized generics or universal base types; , for example, relies on Object as a supertype for polymorphic handling without raw pointer manipulation. This shift prioritizes compile-time type verification over runtime flexibility, aligning with broader efforts to eliminate memory vulnerabilities outside the C family.

Implementations in selected languages

In Java

In Java, the void keyword serves as a return type for methods that do not produce a value upon completion. Such methods perform actions like modifying object or producing side effects without needing to data, as exemplified by the run() method in the Runnable : public void run();. Unlike methods with a specific type, void methods require no return statement with a value at the end, though a bare return; can be used to the method prematurely, such as within conditional blocks to avoid further execution. The java.lang.Void class acts as a non-instantiable placeholder to represent the primitive void type in reflective contexts, holding a reference to the Class object for void. Introduced in JDK 1.1, it is a final class with no public constructors, ensuring it cannot be instantiated, and its sole purpose is to provide a reified type for scenarios where void must be treated as an object type. The class includes a static field TYPE of type Class<Void>, which directly references the void pseudo-type. In generics, introduced in Java 5 (2004), Void functions as a wrapper to denote the absence of a type parameter or return value, enabling constructs like List<Void> for collections that hold no meaningful elements (where the only possible value is null) or Callable<Void> for asynchronous tasks without results. Autoboxing and unboxing do not apply to Void, as there is no primitive counterpart to box, distinguishing it from other wrapper classes like Integer. This usage allows generic APIs, such as those in java.util.concurrent, to handle "no return" cases uniformly without special casing. When a void is declared in an or abstract , any implementing must provide a body that executes the intended logic without attempting to a value, adhering to the of performing side effects only. Failure to implement such methods results in errors, enforcing the 's behavioral requirements. The void type has been a core feature of since its initial release in JDK 1.0 (1996), remaining unchanged in syntax and semantics, while the Void class and its integration with generics enhanced its utility starting from JDK 1.1 and Java 5, respectively.

In Haskell

In Haskell, the Void type is a logically uninhabited data type defined in the Data.Void module of the base library, representing values that cannot exist. It is declared simply as data Void with no constructors, ensuring no values of this type can be constructed at compile time. This type was introduced in base version 4.8.0.0, corresponding to GHC 7.10.1. The primary usage of Void involves functions that handle impossible computations, such as the absurd function with the signature absurd :: Void -> a, which "converts" a Void value into any desired type a via the logical principle of ex falso quodlibet (from falsehood, anything follows). This function is implemented as absurd v = case v of {}, leveraging the impossibility of pattern matching on Void to terminate the case analysis. For instance, in error handling or case analysis, if an impossible branch yields a Void, absurd can produce a value of the expected return type, as in case someEither of Right r -> r; Left l -> absurd l :: Int. While Haskell's undefined (the bottom element) can inhabit Void at runtime, Void itself enforces compile-time uninhabitability, distinguishing it from runtime behaviors. Pattern matching on Void is inherently impossible due to the lack of constructors, making exhaustive matching unachievable and useful for encoding proofs of impossibility or unreachable error states in type-safe code. Any function attempting to destructure a Void value will result in a non-exhaustive pattern match warning, reinforcing its role in formal verification or ensuring total functions by ruling out invalid cases. The separate void package extends utilities around Void for practical applications like traversals in libraries such as optics or data structures, providing functions like vacuous :: Functor f => f Void -> f a, which maps over a functor applied to Void to yield any type a using fmap absurd. This enables safe traversal of structures that might theoretically contain Void (e.g., empty or impossible subcomponents) without runtime errors. In contrast to the unit type (), which has a single constructor and represents a singleton inhabited type for placeholders, Void emphasizes complete emptiness. Void includes vacuous instances for several typeclasses in base, such as Eq, Ord, Show, Read, and Ix, where operations like equality always return False or invoke absurd due to the absence of values—for example, the Show instance uses showsPrec _ v = absurd v. These implementations trivially satisfy the laws since no actual values exist to test against. The void package offers further extensions, including instances for Semigroup and Exception, maintaining this vacuous nature.

In Rust

In Rust, the unit type () serves as the primary equivalent to a void type, representing the absence of a meaningful value. It is a zero-sized type with exactly one possible value, also denoted (), and is used as the default return type for functions that do not explicitly return anything. For instance, a function defined as fn f() {} implicitly returns (), equivalent to fn f() -> () {}. This design allows expressions to be discarded by appending a semicolon, which converts the result to (), emphasizing Rust's expression-oriented nature where every function returns a value. For interoperability with C code via the (FFI), Rust provides the c_void type in the std::ffi module, which corresponds to C's void when used as a pointer. Specifically, *const c_void equates to C's const void* and *mut c_void to void*, enabling the passing of opaque pointers without assuming any particular size or structure for the pointed-to data. This type is typically wrapped in newtypes for safer handling in FFI bindings, as direct use involves unsafe code to prevent invalid memory access. Unlike C's void pointers, which can lead to unchecked dereferencing, Rust requires explicit unsafe blocks for operations on *mut c_void, integrating with the language's ownership model to mitigate common pointer errors. Common usage patterns for void-like types in Rust include employing () in result-handling constructs such as Result and Option to indicate success without associated data; for example, Result<(), E> represents operations that either succeed (with no value) or fail with an error E. Additionally, the never type ! denotes diverging functions that never return normally, such as those invoking panic!() or infinite loops, and can coerce to any other type due to its uninhabited nature. These patterns support idiomatic error handling and control flow without resorting to exceptions. In the 2024 edition (stabilized in Rust 1.85.0, released on February 20, 2025), the type inference fallback for diverging expressions using ! was changed from () to ! itself, improving its usability. Rust's safety features, including the borrow checker and ownership system, prevent misuse akin to unchecked void pointers in C by restricting raw pointer operations like those on c_void to unsafe contexts, where developers must manually verify correctness. Even the unit type, being zero-sized, interacts with lifetimes in generic code—such as in borrowed references &'a ()—ensuring no dangling references without adding overhead. These mechanisms promote at , distinguishing Rust's approach from less guarded void handling in other languages. The unit type has been stable since Rust 1.0, released on May 15, 2015, as a foundational element of the language.

References

  1. [1]
    [PDF] ISO/IEC 9899:2024 (en) — N3220 working draft - Open Standards
    This document specifies the form and interpretation of C programs, promoting portability, reliability, maintainability, and efficient execution.
  2. [2]
    The Void Type (GNU C Language Manual)
    ### Summary of the Void Type in C
  3. [3]
    [PDF] e- American National Standards Institute - keeping simple
    International Standard ISO/IEC 9899 was prepared by Joint Technical ... Unless the type name specifies void type, the type name shall specify qualified or ...
  4. [4]
    Void Pointers (GNU C Language Manual)
    The peculiar type void * , a pointer whose target type is void , is used often in C. It represents a pointer to we-don't-say-what.
  5. [5]
    void - C# reference - Microsoft Learn
    Mar 30, 2024 · You use void as the return type of a method (or a local function) to specify that the method doesn't return a value.
  6. [6]
  7. [7]
    Basic Terminology for Programming in C++ - UCLA CS
    Type void is essentially the absence of any translation rule or storage size. One may therefore argue that void is not a proper type at all. For this reason ...
  8. [8]
    Functions 2: Void (NonValue-Returning) Functions
    Void functions are created and used just like value-returning functions except they do not return a value after the function executes.
  9. [9]
    2. Variables and Types — Programming for Financial Technology
    The void type specifies that no value is available - think of it as “not present”. We cannot create variables of the type void . C++ uses void for several ...
  10. [10]
    [PDF] Gradual Featherweight Typestate - CMU School of Computer Science
    The Void type classifies expressions executed purely for their effects. No source-level values have the Void type. Throughout the discussion of static ...
  11. [11]
    [PDF] Revised REport on the Algorithmic Language Algol 68
    ... void' mode. Machine words, considered as sequences of bits or of bytes, may ... contained in the original Report. 0.4.2. Modes a). In the original ...
  12. [12]
    Algol 68 – A Retrospective - ACCU
    Algol 68 is a procedural language in that its programs are built-up from procedures. A procedure in Algol 68 may be a function that returns a result, or may be ...
  13. [13]
    [PDF] A History of C++: 1979− 1991 - Bjarne Stroustrup
    Jan 1, 1984 · C with Classes introduced the notation f(void) for a function f that takes no arguments as a contrast to f() that in C declares a function that ...
  14. [14]
    [PDF] A History of Haskell: Being Lazy With Class - Microsoft
    Apr 16, 2007 · ... 1990s, Haskell ... The rest of this section summarises the historical development of the main ideas in Haskell's type system, beginning with type ...
  15. [15]
  16. [16]
  17. [17]
    Compiler Error C2562 - Microsoft Learn
    Sep 19, 2025 · The function is declared as void but returns a value. This error can be caused by an incorrect function prototype. This error may be fixed ...
  18. [18]
  19. [19]
    Working with Objects
    ### Summary of Method Declarations with Void Return Type in Objective-C
  20. [20]
    Defining Methods - Learning the Java Language
    The return type—the data type of the value returned by the method, or void if the method does not return a value. The method name—the rules for field names ...
  21. [21]
    Overriding and Hiding Methods (The Java™ Tutorials > Learning the ...
    The ability of a subclass to override a method allows a class to inherit from a superclass whose behavior is "close enough" and then to modify behavior as ...
  22. [22]
    Generic Methods - Java™ Tutorials
    Just like type declarations, method declarations can be generic—that is, parameterized by one or more type parameters. static <T> void fromArrayToCollection(T[] ...
  23. [23]
    Void Type in Java | Baeldung
    Jan 8, 2024 · Learn how to use the Java Void type and when to avoid using the Void type.
  24. [24]
    The history of C# | Microsoft Learn
    This article provides a history of each major release of the C# language. The C# team is continuing to innovate and add new features.Missing: influence | Show results with:influence
  25. [25]
    Void (Java Platform SE 8 ) - Oracle Help Center
    The Void class is an uninstantiable placeholder class to hold a reference to the Class object representing the Java keyword void.Missing: return | Show results with:return
  26. [26]
    Intuitionistic Type Theory - Stanford Encyclopedia of Philosophy
    Feb 12, 2016 · This article describes the formal system of intuitionistic type theory and its semantic foundations. In this entry, we first give an ...
  27. [27]
    [PDF] A Primer on Homotopy Type Theory Part 1 - PhilSci-Archive
    Nov 18, 2014 · The essential ideas of type theory are: • A type theory is a formal system consisting of tokens and types. ... Any empty type is as good as any ...
  28. [28]
    initial object in nLab
    ### Summary of Initial Object Definition and Properties
  29. [29]
    19.10. The Empty Type - Lean
    The presence of a term with type Empty indicates that an impossible code path has been reached. There will never be a value with this type, due to the lack of ...<|separator|>
  30. [30]
    [PDF] Introduction In type theory - UC Berkeley math
    There is a type 1, called the unit type. • There is a term ? : 1. • To ... There is a type 0, called the empty type. • For any type A, there is a ...<|control11|><|separator|>
  31. [31]
    (PDF) An Overview of Type Theories - ResearchGate
    Aug 7, 2025 · Lang T. Type theory Category theory. Types Objects. Unit type (⊤or 1) Terminal object. Product type A×BProduct of objects A×B. Function type A ...
  32. [32]
    empty type in nLab
    Apr 30, 2024 · The empty type is the type with no term. In a model by categorical semantics (cf. relation between type theory and category theory), this is an initial object.
  33. [33]
    A Gentle Introduction to Haskell: IO
    The unit type is similar to void in other languages. Actions are sequenced using an operator that has a rather cryptic name: >>= (or `bind'). Instead of ...
  34. [34]
    unit type in nLab
    Jul 3, 2025 · In type theory, the unit type is the type with a unique term, a special case of a product type with no factors. It is specified by rules.Definition · In natural deduction · In lambda-calculus
  35. [35]
    [PDF] Rationale for International Standard— Programming Languages— C
    Note that there is no such thing as a “void object.” 5. A “pointer to void,” void*, is a generic pointer capable of pointing to any object (except for bit ...<|separator|>
  36. [36]
    [PDF] ISO/IEC 9899:yyyy - Open Standards
    This document specifies the form and establishes the interpretation of programs expressed in the programming language C. Its purpose is to promote portability, ...
  37. [37]
    The void -which-binds, v2: typesafe parametric polymorphism
    Aug 30, 2024 · In other words it introduces a type variable and all void * annotated with the same type variable must convert to or from the same (ignoring ...
  38. [38]
    c_void in std::ffi - Rust
    Equivalent to C's void type when used as a pointer. In essence, *const c_void is equivalent to C's const void* and *mut c_void is equivalent to C's void* . ...
  39. [39]
    unsafe - Go Packages
    Pointer or reflect.Value.UnsafeAddr from uintptr to Pointer. Package reflect's Value methods named Pointer and UnsafeAddr return type uintptr instead of unsafe.<|separator|>
  40. [40]
    Types - D Programming Language
    Oct 10, 2025 · Any pointer implicitly converts to a void pointer. As for void arrays, the void element type may need a type qualifier. Function pointers and ...
  41. [41]
    Attributes - D Programming Language
    Oct 10, 2025 · Attributes are a way to modify one or more declarations. The general forms are: attribute declaration; // affects the declaration attribute: // affects all ...
  42. [42]
    Migrating C to Rust for Memory Safety - IEEE Computer Society
    Most languages outside the C family are memory safe, meaning that invalid memory accesses are detected one way or another and terminate the program with an ...<|control11|><|separator|>
  43. [43]
    Returning a Value from a Method (The Java™ Tutorials > Learning ...
    Any method that is not declared void must contain a return statement with a corresponding return value, like this: return returnValue;
  44. [44]
    Data.Void - Hackage
    Data.Void: A logically uninhabited data type, used to indicate that a given term should not exist.
  45. [45]
    void: A Haskell 98 logically uninhabited data type - Hackage
    May 10, 2019 · This package provides a canonical 'uninhabited' data type for Haskell. This arises in a surprisingly wide array of situations in practice.<|separator|>
  46. [46]
    Data.Void - Hackage
    Documentation ; Read Void. Reading a Void value is always a parse error, considering Void as a data type with no constructors. ; Show Void ; Ix Void ; Generic Void.
  47. [47]
    unit - Rust
    The () type, also called “unit”. The () type has exactly one value () , and is used when there is no other meaningful value that could be returned.
  48. [48]
    Never type - The Rust Reference
    The never type ! is a type with no values, representing the result of computations that never complete.
  49. [49]
    Announcing Rust 1.0 | Rust Blog
    May 15, 2015 · Announcing Rust 1.0. May 15, 2015 · The Rust Core Team. Today we are very proud to announce the 1.0 release of Rust, a new programming ...
  50. [50]
    Announcing Rust 1.41.0
    Jan 30, 2020 · The Rust team is happy to announce a new version of Rust, 1.41.0. Rust is a programming language that is empowering everyone to build reliable and efficient ...