pub fn with_capacity(capacity: usize) -> Self {

        let mut buffer = Vec::with_capacity(capacity+1);
        for _ in 0..capacity+1 {
            buffer.push(ManuallyDrop::new(unsafe{uninitialized()}));
        }
        Self {
            buffer: buffer.into_boxed_slice(),
            start: 0,
            end: 0
        }
    }
/**
    Creates a new instance of `CircularBuffer` with the given capacity.

    # Example

    ```
    use advanced_collections::circular_buffer::CircularBuffer;

    fn main(){
        let cb:CircularBuffer<i32> = CircularBuffer::with_capacity(5);
        assert_eq!(cb.capacity(), 5);
    }
    ```
    */
Creates a new instance of `CircularBuffer` with the given capacity.
Creates a new instance of ` CircularBuffer ` with the given capacity .
pub fn with_capacity(capacity: usize) -> Self {
        let mut buffer = Vec::with_capacity(capacity+1);
        for _ in 0..capacity+1 {
            buffer.push(ManuallyDrop::new(unsafe{uninitialized()}));
        }
        Self {
            buffer: buffer.into_boxed_slice(),
            start: 0,
            end: 0
        }
    }
pub fn with_capacity ( capacity : usize ) -> Self { let mut buffer = Vec :: with_capacity ( capacity + 1 ) ; for _ in 0 .. capacity + 1 { buffer . push ( ManuallyDrop :: new ( unsafe { uninitialized ( ) } ) ) ; } Self { buffer : buffer . into_boxed_slice ( ) , start : 0 , end : 0 } }
Creates a new instance of `CircularBuffer` with the given capacity.
Creates a new instance of ` CircularBuffer ` with the given capacity .
capacity
usize
capacity
usize
example
```
use advanced_collections::circular_buffer::CircularBuffer.

fn main(){
let cb:CircularBuffer = CircularBuffer::with_capacity(5);
assert_eq!(cb.capacity(), 5);
}
```
` ` ` use advanced_collections :: circular_buffer :: CircularBuffer . fn main () { let cb : CircularBuffer = CircularBuffer :: with_capacity ( 5 ) ; assert_eq! ( cb . capacity () 5 ) ; } ` ` `